Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit bd952d3

Browse files
jchipzkat
authored andcommitted
fix(fs): return after calling cb in chmod (#33)
1 parent a33cca1 commit bd952d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/node/fs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ function overrideNode () {
431431

432432
patchFn('chmod', chmod => (p, mode, cb) => {
433433
return chmod(p, mode, (err) => {
434-
if (!err || err.code !== 'ENOENT') { cb(err) }
434+
if (!err || err.code !== 'ENOENT') { return cb(err) }
435435

436436
const resolved = pkglock.resolve(p)
437437
if (!resolved) {
@@ -441,9 +441,9 @@ function overrideNode () {
441441
}
442442

443443
return mkdirp(path.dirname(p), err => {
444-
if (err) { cb(err) }
444+
if (err) { return cb(err) }
445445
fs.readFile(p, (err, data) => {
446-
if (err) { cb(err) }
446+
if (err) { return cb(err) }
447447
fs.writeFile(p, data, { mode }, cb)
448448
})
449449
})

0 commit comments

Comments
 (0)