diff options
Diffstat (limited to 'node_modules/fs-extra/lib')
-rw-r--r-- | node_modules/fs-extra/lib/fs/index.js | 12 | ||||
-rw-r--r-- | node_modules/fs-extra/lib/remove/rimraf.js | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/node_modules/fs-extra/lib/fs/index.js b/node_modules/fs-extra/lib/fs/index.js index 551ca6a09..1821fd000 100644 --- a/node_modules/fs-extra/lib/fs/index.js +++ b/node_modules/fs-extra/lib/fs/index.js @@ -9,6 +9,7 @@ const api = [ 'chmod', 'chown', 'close', + 'copyFile', 'fchmod', 'fchown', 'fdatasync', @@ -20,6 +21,7 @@ const api = [ 'link', 'lstat', 'mkdir', + 'mkdtemp', 'open', 'readFile', 'readdir', @@ -33,9 +35,13 @@ const api = [ 'unlink', 'utimes', 'writeFile' -] -// fs.mkdtemp() was added in Node.js v5.10.0, so check if it exists -typeof fs.mkdtemp === 'function' && api.push('mkdtemp') +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) // Export all keys: Object.keys(fs).forEach(key => { diff --git a/node_modules/fs-extra/lib/remove/rimraf.js b/node_modules/fs-extra/lib/remove/rimraf.js index 15924c37f..f07869457 100644 --- a/node_modules/fs-extra/lib/remove/rimraf.js +++ b/node_modules/fs-extra/lib/remove/rimraf.js @@ -117,7 +117,7 @@ function fixWinEPERM (p, options, er, cb) { assert(er instanceof Error) } - options.chmod(p, 666, er2 => { + options.chmod(p, 0o666, er2 => { if (er2) { cb(er2.code === 'ENOENT' ? null : er) } else { @@ -144,7 +144,7 @@ function fixWinEPERMSync (p, options, er) { } try { - options.chmodSync(p, 666) + options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === 'ENOENT') { return |