From 933d80bb3780b4b861f1ba5e75507238e0689ab6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 30 Dec 2016 00:12:00 -0800 Subject: [PATCH] util: fix mkdirp error on windows. --- lib/utils/util.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/utils/util.js b/lib/utils/util.js index 39daf1c7..c55b3946 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -1005,9 +1005,11 @@ util.mkdirp = function mkdirp(path) { path = parts.shift() + '/'; } - if (parts[0].length === 0) { - parts.shift(); - path = '/'; + if (parts.length > 0) { + if (parts[0].length === 0) { + parts.shift(); + path = '/'; + } } for (i = 0; i < parts.length; i++) {