Skip to content

Commit

Permalink
fix infinite loop on windows machines
Browse files Browse the repository at this point in the history
PR-URL: #15
Credit: @jonchurch
Close: #15
Reviewed-by: @isaacs
  • Loading branch information
jonchurch authored and isaacs committed Mar 23, 2020
1 parent d784e70 commit 2867920
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function mkdirP (p, opts, f, made) {
}
switch (er.code) {
case 'ENOENT':
if (path.dirname(p) === p) return cb(er);
mkdirP(path.dirname(p), opts, function (er, made) {
if (er) cb(er, made);
else mkdirP(p, opts, cb, made);
Expand Down

0 comments on commit 2867920

Please sign in to comment.