[Mkdirp] Fix still causing callback error with async
This commit is contained in:
parent
603d92967b
commit
476b41af97
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue