From eb4101314140e41913aad8044eedbab7a25111e1 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Wed, 22 Apr 2020 10:02:45 -0400 Subject: [PATCH] Stop using `process.umask()` Ref nodejs/node#32321 --- mkdirp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mkdirp.js b/mkdirp.js index 677a43d..000ac18 100644 --- a/mkdirp.js +++ b/mkdirp.js @@ -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); @@ -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(); } @@ -64,7 +64,7 @@ function mkdirp(dirpath, customMode, callback) { return callback(recurseErr); } - mkdirp(dirpath, mode, callback); + mkdirp(dirpath, customMode, callback); } }