diff --git a/lib/createOutputStream/writeBuffer.js b/lib/createOutputStream/writeBuffer.js index 36fc4469..9d1094d3 100644 --- a/lib/createOutputStream/writeBuffer.js +++ b/lib/createOutputStream/writeBuffer.js @@ -1,5 +1,5 @@ var fs = require('fs'); -module.exports = function(file, cb) { +module.exports = function(writePath, file, cb) { fs.writeFile(writePath, file.contents, cb); }; \ No newline at end of file diff --git a/lib/createOutputStream/writeContents.js b/lib/createOutputStream/writeContents.js index ec360e34..5bbbd12c 100644 --- a/lib/createOutputStream/writeContents.js +++ b/lib/createOutputStream/writeContents.js @@ -1,3 +1,7 @@ +var writeDir = require('./writeDir'); +var writeStream = require('./writeStream'); +var writeBuffer = require('./writeBuffer'); + module.exports = function (writePath, file, cb) { var done = function(err){ if (err) return cb(err); @@ -16,13 +20,13 @@ module.exports = function (writePath, file, cb) { // stream it to disk yo if (file.isStream()) { - writeStream(file, done); + writeStream(writePath, file, done); return; } if (file.isBuffer()) { // write it like normal - writeBuffer(file, done); + writeBuffer(writePath, file, done); return; } }; \ No newline at end of file diff --git a/lib/createOutputStream/writeStream.js b/lib/createOutputStream/writeStream.js index 71e06d1d..8771ee4e 100644 --- a/lib/createOutputStream/writeStream.js +++ b/lib/createOutputStream/writeStream.js @@ -1,4 +1,4 @@ -module.exports = function(file, cb) { +module.exports = function(writePath, file, cb) { var outStream = fs.createWriteStream(writePath); file.contents.once('error', cb); file.contents.once('end', function(){