refactor: improve async handling

This commit is contained in:
Carlos Valente
2025-02-15 14:05:53 +01:00
committed by Carlos Valente
parent c65761448d
commit 891bda6661
8 changed files with 88 additions and 87 deletions
+3 -3
View File
@@ -6,14 +6,14 @@ import { publicDir, publicFiles, srcDir, srcFiles } from './index.js';
/**
* @description ensures directories exist and populates demo folder
*/
export const populateDemo = () => {
export async function populateDemo() {
ensureDirectory(publicDir.demoDir);
try {
copyFileSync(srcFiles.externalReadme, publicFiles.externalReadme);
// even if demo exist we want to use startup demo
copyDirectory(srcDir.demoDir, publicDir.demoDir);
await copyDirectory(srcDir.demoDir, publicDir.demoDir);
} catch (_) {
/* we do not handle this */
}
};
}