Skip to content

Commit

Permalink
fix: creating-log-folder-in-sync-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
QS20199 authored and remz committed Dec 29, 2020
1 parent e1bf95f commit 864b084
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,12 @@ Common.prepareAppConf = function(opts, app) {
if (!fs.existsSync(dir)) {
Common.printError(cst.PREFIX_MSG_WARNING + 'Folder does not exist: ' + dir);
Common.printOut(cst.PREFIX_MSG + 'Creating folder: ' + dir);
require('mkdirp')(dir)
.then(() => {
return;
})
.catch(err => {
Common.printError(cst.PREFIX_MSG_ERR + 'Could not create folder: ' + path.dirname(af));
throw new Error('Could not create folder');
})
try {
require('mkdirp').sync(dir);
} catch (err) {
Common.printError(cst.PREFIX_MSG_ERR + 'Could not create folder: ' + path.dirname(af));
throw new Error('Could not create folder');
}
}

}
Expand Down

0 comments on commit 864b084

Please sign in to comment.