Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/millstone.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,14 @@ function localize(url, options, callback) {
}
}
var dir_path = path.dirname(options.filepath);
mkdirp(dir_path, 0755, function(err) {
if (err && err.code !== 'EEXIST') {
mkdirp(dir_path, 0755).then(() => {
download(url, options, function(err, filepath) {
if (err) return callback(err);
callback(null, filepath);
});
})
.catch((err) => {
if ( err.code !== 'EEXIST') {
if (env == 'development') console.error('[millstone] could not create directory: ' + dir_path);
callback(err);
} else {
Expand Down Expand Up @@ -529,8 +535,9 @@ function resolve(options, callback) {
benchmark = options.benchmark;

Step(function setup() {
if (nosymlink) mkdirp(base, 0755, this);
else mkdirp(path.join(base, 'layers'), 0755, this);
var me = this;
if (nosymlink) mkdirp(base, 0755).then(() => {me()}).catch((e)=>{me(e)});
else mkdirp(path.join(base, 'layers'), 0755).then(() => {me()}).catch((e)=>{me(e)});
}, function style_externals(err) {
if (err && err.code !== 'EEXIST') throw err;
if (benchmark) console.time("[millstone][benchmark] Resolving style (mss) externals");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"zipfile": "~0.5.5",
"sqlite3": "4.1.0",
"mime": "~1.2.11",
"mkdirp": "~0.5.0",
"mkdirp": "^1.0.3",
"optimist": "~0.6.1"
},
"devDependencies": {
Expand Down