From 38a30bcc49b51de1993c3c6e781db3dbb6c11b05 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 2 Oct 2020 09:33:57 +0200 Subject: [PATCH] targetDir doesn't need to be global anymore --- scripts/build.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index f8e1a110..165354c5 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -45,7 +45,6 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const projectDir = path.join(__dirname, "../"); const cssSrcDir = path.join(projectDir, "src/ui/web/css/"); -const targetDir = path.join(projectDir, "target/"); const program = new commander.Command(); program @@ -65,6 +64,7 @@ async function build() { themes.push(themeName); }); // clear target dir + const targetDir = path.join(projectDir, "target/"); await removeDirIfExists(targetDir); await createDirs(targetDir, themes); const assets = new AssetMap(targetDir); @@ -111,7 +111,7 @@ async function createDirs(targetDir, themes) { async function copyThemeAssets(themes, assets) { for (const theme of themes) { - const themeDstFolder = path.join(targetDir, `themes/${theme}`); + const themeDstFolder = path.join(assets.directory, `themes/${theme}`); const themeSrcFolder = path.join(cssSrcDir, `themes/${theme}`); const themeAssets = await copyFolder(themeSrcFolder, themeDstFolder, file => { return !file.endsWith(".css");