Fix JS mkPath.

This commit is contained in:
Arthur Britto
2012-09-17 15:45:04 -07:00
parent 6847aaace5
commit b6771dcae9

View File

@@ -38,8 +38,8 @@ var mapOr = function(func, array, done) {
// Make a directory and sub-directories.
var mkPath = function(dirPath, mode, done) {
fs.mkdir(dirPath, typeof mode === "string" ? parseInt(mode, 8) : mode, function (e) {
if (e && e.code === "EEXIST") {
// Already exists, done.
if (!e || e.code === "EEXIST") {
// Created or already exists, done.
done();
}
else if (e.code === "ENOENT") {