Skip to content

Build your personal knowledge base with Trilium Notes

build(copy-dist): execute code in try/catch -> get rid of function

Panagiotis Papadopoulos3032156b45dd
diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts
index 9f52f8a5d4..f752782c9e 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