From 9ac451e2b2570d12efd66fa6a7bde33ff8c5b288 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 27 Feb 2025 08:01:07 +0100 Subject: [PATCH] build(copy-dist): consolidate files and folder copying into one asset copying job there's no benefit in having them split up like before --- bin/copy-dist.ts | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 208825b46..c7bd8c809 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -29,32 +29,26 @@ const copy = async () => { fs.copySync(path.join("build", srcFile), destFile, { recursive: true }); } - const filesToCopy = [ - "config-sample.ini", + const assetsToCopy = new Set([ + "./images", + "./libraries", + "./translations", + "./db", + "./config-sample.ini", + "./src/views/", "./src/etapi/etapi.openapi.yaml", "./src/routes/api/openapi.json", "./src/public/icon.png", "./src/public/manifest.webmanifest", - "./src/public/robots.txt" - ]; - for (const file of filesToCopy) { - log(`Copying ${file}`); - await fs.copy(file, path.join(DEST_DIR, file)); - } + "./src/public/robots.txt", + "./src/public/fonts", + "./src/public/stylesheets", + "./src/public/translations" + ]); - const dirsToCopy = [ - "images", - "libraries", - "translations", - "db", - "src/public/fonts", - "src/public/stylesheets", - "src/public/translations", - "src/views/" - ]; - for (const dir of dirsToCopy) { - log(`Copying ${dir}`); - await fs.copy(dir, path.join(DEST_DIR, dir)); + for (const asset of assetsToCopy) { + log(`Copying ${asset}`); + await fs.copy(asset, path.join(DEST_DIR, asset)); } /**