From cf29eef1ef5d5b64607ff50ccfc425bef04c3aba Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Sun, 16 Mar 2014 11:47:55 -0400 Subject: [PATCH] Rebase and fix failing tests in mkdirp --- src/shell.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shell.js b/src/shell.js index e3bd023..41cc09d 100644 --- a/src/shell.js +++ b/src/shell.js @@ -354,8 +354,8 @@ define(function(require) { }; /** - * Recursively creates the directory at `path`. If the parent - * of `path` does not exist, it will be created. + * Recursively creates the directory at `path`. If the parent + * of `path` does not exist, it will be created. * Based off EnsureDir by Sam X. Xu * https://www.npmjs.org/package/ensureDir * MIT License @@ -365,7 +365,7 @@ define(function(require) { callback = callback || function(){}; if(!path) { - callback(new Errors.EInvalid()); + callback(new Errors.EINVAL('missing path argument')); return; } else if (path === '/'){ @@ -374,7 +374,7 @@ define(function(require) { } function _mkdirp(path, callback){ fs.stat(path, function (err, stat) { - //doesn't exist + //doesn't exist if (err && err.code === 'ENOENT') { var parent = Path.dirname(path); if(parent === '/'){ //parent is root @@ -413,7 +413,7 @@ define(function(require) { } //not a directory else if (stat.type === 'FILE') { - callback(new Errors.ENotDirectory()); + callback(new Errors.ENOTDIR()); return; } });