[Mkdirp] Fix still causing callback error with async

This commit is contained in:
Ducko 2021-12-10 20:00:24 +00:00
parent 603d92967b
commit 476b41af97
1 changed files with 4 additions and 4 deletions

View File

@ -8,9 +8,9 @@ const fs = require('fs');
const async = (path, callback) => { // async const async = (path, callback) => { // async
log('Mkdirp', 'Async:', path); log('Mkdirp', 'Async:', path);
try { fs.mkdir(path, () => { // Ignore errors (already exists)
fs.mkdir(path, callback, { recursive: true }); callback();
} catch (e) { } // Doesn't exist, ignore }, { recursive: true });
}; };
const sync = (path) => { // sync const sync = (path) => { // sync
@ -18,7 +18,7 @@ const sync = (path) => { // sync
try { try {
fs.mkdirSync(path, { recursive: true }); fs.mkdirSync(path, { recursive: true });
} catch (e) { } // Doesn't exist, ignore } catch (e) { } // Already exists, ignore
}; };
const toExport = async; const toExport = async;