Skip to content

Commit

Permalink
[New Theme] Rename aliased CSS assets (#863) (#864)
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
(cherry picked from commit 9f4bf5b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 28c59b7 commit 88c8af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/compile-scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ async function compileScssFiles(
const { name } = path.parse(inputFilename);
const outputFilenames = await compileScssFile(
inputFilename,
path.join(destinationDirectory, `eui_${name.replace('next', 'amsterdam')}.css`),
path.join(destinationDirectory, `eui_${name.replace('next', 'amsterdam')}.json`),
path.join(destinationDirectory, `eui_${name.replace('next', 'amsterdam')}.json.d.ts`),
path.join(destinationDirectory, `eui_${name}.css`),
path.join(destinationDirectory, `eui_${name}.json`),
path.join(destinationDirectory, `eui_${name}.json.d.ts`),
packageName,
true
);
Expand Down
7 changes: 3 additions & 4 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { INIT_CWD, PWD = process.cwd() } = process.env;
if (!INIT_CWD?.startsWith?.(PWD)) {
// Clean up and recreate the folders
fs.rmSync('src/themes/eui', { recursive: true, force: true });
fs.rmSync('src/themes/eui-amsterdam', { recursive: true, force: true });
fs.rmSync('src/themes/eui-next', { recursive: true, force: true });

const copyDirectory = (src, dest) => {
fs.mkdirSync(dest, { recursive: true });
Expand All @@ -35,15 +35,14 @@ if (!INIT_CWD?.startsWith?.(PWD)) {
const srcItem = path.join(src, entry.name);
const destItem = path
.join(dest, entry.name)
.replace('oui', 'eui')
.replace('next', 'amsterdam');
.replace('oui', 'eui');

if (entry.isDirectory()) copyDirectory(srcItem, destItem);
else fs.copyFileSync(srcItem, destItem);
}
};

copyDirectory('src/themes/oui', 'src/themes/eui');
copyDirectory('src/themes/oui-next', 'src/themes/eui-amsterdam');
copyDirectory('src/themes/oui-next', 'src/themes/eui-next');
}
/* End of Aliases */

0 comments on commit 88c8af6

Please sign in to comment.