@samitouri / QOSami-HFS / commits / f5f9eeaa

fix: crash if cwd doesn't exist and neither its parent

Massimo Melina committed Jan 2, 2025 at 23:45 UTC f5f9eeaab24f6844930ec7f156dd2536f73107a1
1 file changed +1 -1
src/const.ts
+1 -1
@@ -50,7 +50,7 @@ console.debug('arguments', argv)
50 // still considering whether to use ".hfs" with Windows users, who may be less accustomed to it
51 const dir = argv.cwd || useHomeDir() && join(homedir(), '.hfs')
52 if (dir) {
53 - try { fs.mkdirSync(dir) }
53 + try { fs.mkdirSync(dir, { recursive: true }) }
54 catch(e: any) {
55 if (e.code !== 'EEXIST')
56 console.error(e)