Skip to content

Commit 277a149

Browse files
committed
Fix node fs mkdir
1 parent 44303df commit 277a149

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/fs/node.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ FS.prototype.write = function write(filePath, buf) {
6767

6868
return this.mkdir(path.dirname(filePath))
6969
.then(function() {
70-
return Promise.nfcall(this.fs.writeFile, that.path(filePath), buf);
70+
return Promise.nfcall(that.fs.writeFile, that.path(filePath), buf);
7171
});
7272
};
7373

@@ -86,6 +86,10 @@ FS.prototype.unlink = function unlink(filePath) {
8686
* @return {Promise}
8787
*/
8888
FS.prototype.mkdir = function mkdir(filePath) {
89+
if (this.fs.mkdirp) {
90+
return Promise.nfcall(this.fs.mkdirp, this.path(filePath));
91+
}
92+
8993
return Promise.nfcall(mkdirp, this.path(filePath), {
9094
fs: this.fs
9195
});

0 commit comments

Comments
 (0)