Skip to content

Commit

Permalink
clean up callbacks in download
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Jan 19, 2016
1 parent a5f9f38 commit 6204fcf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions download.js
Expand Up @@ -97,10 +97,8 @@ function downloadPrebuild (opts, cb) {
return cb(err)
}
log.info('unpack', 'required ' + resolved + ' successfully')
cb(null, resolved)
} else {
cb(null, resolved)
}
cb(null, resolved)
})
}

Expand All @@ -111,8 +109,7 @@ function downloadPrebuild (opts, cb) {
if (err && err.code === 'ENOENT') {
return makeNpmCacheDir()
}
if (err) return cb(err)
cb()
cb(err)
})
} else {
fs.exists(cacheFolder, function (exists) {
Expand All @@ -123,10 +120,7 @@ function downloadPrebuild (opts, cb) {

function makeNpmCacheDir () {
log.info('npm cache directory missing, creating it...')
fs.mkdir(cacheFolder, function (err) {
if (err) return cb(err)
cb()
})
fs.mkdir(cacheFolder, cb)
}
}
}
Expand Down

0 comments on commit 6204fcf

Please sign in to comment.