Skip to content

Commit

Permalink
Stop using process.umask()
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell committed May 4, 2020
1 parent fe502f4 commit f345cf3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mkdirp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function mkdirp(dirpath, customMode, callback) {
customMode = undefined;
}

var mode = customMode || DEFAULT_DIR_MODE & ~process.umask();
var mode = customMode || DEFAULT_DIR_MODE;
dirpath = path.resolve(dirpath);

fs.mkdir(dirpath, mode, onMkdir);
Expand Down Expand Up @@ -46,12 +46,12 @@ function mkdirp(dirpath, customMode, callback) {
return callback(mkdirErr);
}

// TODO: Is it proper to mask like this?
if ((stats.mode & MASK_MODE) === mode) {
if (!customMode) {
return callback();
}

if (!customMode) {
// TODO: Is it proper to mask like this?
if ((stats.mode & MASK_MODE) === mode) {
return callback();
}

Expand All @@ -64,7 +64,7 @@ function mkdirp(dirpath, customMode, callback) {
return callback(recurseErr);
}

mkdirp(dirpath, mode, callback);
mkdirp(dirpath, customMode, callback);
}
}

Expand Down

0 comments on commit f345cf3

Please sign in to comment.