Skip to content

Commit

Permalink
avoid else-if and isFatal variable
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 26, 2015
1 parent 6b9912e commit 00ece7e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/dest/writeContents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,17 @@ function writeContents(writePath, file, cb) {
}

function isErrorFatal(err) {
var isFatal = true;
if (!err) {
isFatal = false;
} else if (err.code === 'EEXIST' && file.flag === 'wx') {
return false;
}

if (err.code === 'EEXIST' && file.flag === 'wx') {
// Handle scenario for file overwrite failures.
isFatal = false; // "These aren't the droids you're looking for"
return false; // "These aren't the droids you're looking for"
}

// Otherwise, this is a fatal error
return isFatal;
return true;
}
}

Expand Down

0 comments on commit 00ece7e

Please sign in to comment.