Using original existence check with mkdirp call on failure

This commit is contained in:
FredyC
2013-08-01 17:03:32 +02:00
parent 457cdfde26
commit e644f7244d
2 changed files with 14 additions and 5 deletions

View File

@@ -427,11 +427,18 @@
});
}
};
return mkdirp(jsDir, function(err) {
if (!err) {
return exists(jsDir, function(itExists) {
var _this = this;
if (itExists) {
return compile();
} else {
return exec("mkdir -p " + jsDir, compile);
return mkdirp(jsDir, function(err) {
if (err) {
printLine("Error while creating dir " + jsDir + ": " + err);
exec("mkdir -p " + jsDir);
}
return compile();
});
}
});
};