Skip to content

Commit

Permalink
Merge pull request mikeal#9 from naholyr/patch-3
Browse files Browse the repository at this point in the history
Create a WriteStream instead of emitting an error on non-existing file
  • Loading branch information
mikeal committed Oct 31, 2011
2 parents e1bfe58 + fbf5b5f commit a6346ee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function File (options) {
fs.stat(options.path, function (err, stats) {

var finish = function (err, stats) {
if (err && err.code === 'ENOENT' && !self.dest && !self.src) self.src = self.path
if (err && !self.dest && !self.src) return self.emit('error', err)
if (err && self.dest && !self.dest.writeHead) return self.emit('error', err)

Expand Down

0 comments on commit a6346ee

Please sign in to comment.