(cherry picked from commit 911c0880dd
)
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
parent
ecaa3c8e2f
commit
5fc023c6ef
|
@ -30,15 +30,17 @@ function dirExistsAsync(path) {
|
||||||
function mkDirAsync(path) {
|
function mkDirAsync(path) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
dirExistsAsync(path).then((exists) => {
|
dirExistsAsync(path).then((exists) => {
|
||||||
if (!exists) {
|
if (exists) {
|
||||||
fs.mkdir(path, {recursive: true}, (error) => {
|
resolve();
|
||||||
if (error) {
|
return;
|
||||||
reject(error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
fs.mkdir(path, {recursive: true}, (error) => {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue