diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-06-05 21:17:34 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-06-06 00:20:51 +0300 |
commit | 6e12a5cc022cb5a157a37df7283b6d7b3d49bdab (patch) | |
tree | bf48d3b7bf1e1ad936936e113e72b594a55cd6f0 /node_modules/cacache/lib/util/move-file.js | |
parent | 0b9fc56a8e451003a613f75b166cfacc49e2d9a9 (diff) |
deps: bump cacache, pacote, ssri, readable-stream, safe-buffer
Diffstat (limited to 'node_modules/cacache/lib/util/move-file.js')
-rw-r--r-- | node_modules/cacache/lib/util/move-file.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/node_modules/cacache/lib/util/move-file.js b/node_modules/cacache/lib/util/move-file.js index 422c8294e..e12e98188 100644 --- a/node_modules/cacache/lib/util/move-file.js +++ b/node_modules/cacache/lib/util/move-file.js @@ -2,6 +2,8 @@ const fs = require('graceful-fs') const BB = require('bluebird') +const chmod = BB.promisify(fs.chmod) +const unlink = BB.promisify(fs.unlink) let move let pinflight @@ -27,8 +29,11 @@ function moveFile (src, dest) { return cb(err) } } - return fs.unlink(src, cb) + return cb() }) + }).then(() => { + // content should never change for any reason, so make it read-only + return BB.join(unlink(src), process.platform !== 'win32' && chmod(dest, '0444')) }).catch(err => { if (process.platform !== 'win32') { throw err |