Skip to content

Commit

Permalink
[New Theme] Rename aliases CSS assets
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <miki@amazon.com>
  • Loading branch information
AMoo-Miki committed Jun 29, 2023
1 parent a938432 commit 502d132
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 502d132

Please sign in to comment.