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
This commit is contained in:
Panagiotis Papadopoulos 2025-02-27 09:10:27 +01:00 committed by Panagiotis Papadopoulos
parent d75cf8c11e
commit 3032156b45

View File

@ -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)
}