Skip to content

Commit 1c6633d

Browse files
author
Sebastian.Just
committed
Create folder appropriatly
1 parent ffb0c0a commit 1c6633d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/fileinfo.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var fs = require('fs'),
2+
mkdirp = require('mkdirp'),
23
_ = require('lodash');
34

45
module.exports = function (options) {
@@ -36,7 +37,10 @@ module.exports = function (options) {
3637
}
3738
}
3839
//Touch the file to be sure. Synchronous to have this done before the emit of 'begin' happens
39-
fs.closeSync(fs.openSync(options.baseDir() + '/' + this.name, 'w'));
40+
mkdirp(options.baseDir(), function (err) {
41+
if (err) {}
42+
else {fs.closeSync(fs.openSync(options.baseDir() + '/' + this.name, 'w'));}
43+
});
4044
};
4145

4246
FileInfo.prototype.setUrl = function (type, baseUrl) {

0 commit comments

Comments
 (0)