Skip to content

Commit

Permalink
Fix shortcircuiting on both mode and chown
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed Jan 6, 2017
1 parent c29f37c commit e16442a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function writeFile (filename, data, options, callback) {
if (!options) options = {}
var tmpfile = getTmpname(filename)

if (options.mode && options.chmod) {
if (options.mode && options.chown) {
return thenWriteFile()
} else {
// Either mode or chown is not explicitly set
Expand Down Expand Up @@ -57,7 +57,7 @@ module.exports.sync = function writeFileSync (filename, data, options) {
var tmpfile = getTmpname(filename)

try {
if (!options.mode || !options.chmod) {
if (!options.mode || !options.chown) {
// Either mode or chown is not explicitly set
// Default behavior is to copy it from original file
try {
Expand Down

0 comments on commit e16442a

Please sign in to comment.