Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added detection of files without a source or destination.

  • Loading branch information...
commit aa4082d6d07b2f34602a994fa790de4c9bc27649 1 parent 7c487f3
@mikeal mikeal authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 main.js
View
10 main.js
@@ -151,6 +151,16 @@ function File (options) {
} else {
finish(err, stats)
}
+
+ if (!self.src && !self.dest) {
+ if (self.buffers.length > 0) {
+ stream.Stream.prototype.pipe.call(self, fs.createWriteStream(self.path))
+ } else if (self.listeners('data').length > 0) {
+ fs.createReadStream(self.path).pipe(self.dest)
+ } else {
+ throw new Error('Not Implemented, lazy (future) dynamic read/write discovery,')
+ }
+ }
})
Please sign in to comment.
Something went wrong with that request. Please try again.