Skip to content

Commit 40c1157

Browse files
committed
fix: init logging
1 parent 2e830bf commit 40c1157

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/server.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,10 @@ class CoCreateLazyLoader {
2121
const scriptsDirectory = './scripts';
2222

2323
try {
24-
await fs.access(directory);
25-
console.log("The directory exists.");
24+
await fs.mkdir(scriptsDirectory, { recursive: true });
2625
} catch (error) {
27-
try {
28-
await fs.mkdir(scriptsDirectory, { recursive: true });
29-
console.log(`Scripts directory created at ${scriptsDirectory}`);
30-
} catch (error) {
31-
console.error('Error creating scripts directory:', error);
32-
throw error; // Halt execution if directory creation fails
33-
}
26+
console.error('Error creating scripts directory:', error);
27+
throw error; // Halt execution if directory creation fails
3428
}
3529

3630
this.modules = await Config('modules', false, false)

0 commit comments

Comments
 (0)