Skip to content

Commit 1df08e0

Browse files
authored
Merge pull request #5 from kaloczikvn/master
Fix: fix mkdirp error
2 parents b7ff649 + 4c32a7f commit 1df08e0

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎bin/cli.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ writeFile(destination, jsonContent, (err) => {
2929
});
3030

3131
function writeFile(path, contents, cb) {
32-
mkdirp(getDirName(path), (err) => {
33-
if (err) return cb(err);
34-
fs.writeFile(path, contents, cb);
35-
});
32+
mkdirp(getDirName(path))
33+
.then(() => {
34+
fs.writeFile(path, contents, cb);
35+
})
36+
.catch(err => {
37+
return cb(err);
38+
});
3639
}

0 commit comments

Comments
 (0)