From 3032156b45dd611e1328ecbce66c10fcf8f6bd67 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 27 Feb 2025 09:10:27 +0100 Subject: [PATCH] build(copy-dist): execute code in try/catch -> get rid of function since we don't export this anywhere, might as well just call the steps directly --- bin/copy-dist.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 9f52f8a5d..f752782c9 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -18,7 +18,8 @@ function copyNodeModuleFileOrFolder(source: string) { fs.copySync(source, destination); } -const copy = async () => { +try { + log(`Copying build into dist folder.`); fs.copySync("./build", DEST_DIR); @@ -99,8 +100,8 @@ const copy = async () => { for (const nodeModuleItem of [...nodeModulesFile, ...nodeModulesFolder]) { copyNodeModuleFileOrFolder(nodeModuleItem); } -}; + console.log("Copying complete!") -copy() - .then(() => console.log("Copying complete!")) - .catch((err) => console.error("Error during copy:", err)); +} catch(err) { + console.error("Error during copy:", err) +} \ No newline at end of file