0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

fix deprecared warning with fs.unlink

Since NodeJS 7,  call async api without callback is deprecared.
This commit is contained in:
Meeeeow 2017-04-20 23:33:28 +08:00
parent 62ef3d91b6
commit ea4f8474c1

View file

@ -18,7 +18,7 @@ function tempFile(str) {
function renameTmp(src, dst, _cb) {
function cb(err) {
if (err) fs.unlink(src)
if (err) fs.unlink(src, function() {})
_cb(err)
}
@ -31,7 +31,7 @@ function renameTmp(src, dst, _cb) {
var tmp = tempFile(dst)
fs.rename(dst, tmp, function(err) {
fs.rename(src, dst, cb)
if (!err) fs.unlink(tmp)
if (!err) fs.unlink(tmp, function () {})
})
}