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:
parent
62ef3d91b6
commit
ea4f8474c1
1 changed files with 2 additions and 2 deletions
|
@ -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 () {})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue