Skip to content

Commit

Permalink
Fix: Resolve broken refactor problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan You authored and phated committed Nov 27, 2017
1 parent c82db3e commit c196935
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/createOutputStream/writeBuffer.js
Original file line number Diff line number Diff line change
@@ -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);
};
8 changes: 6 additions & 2 deletions lib/createOutputStream/writeContents.js
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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;
}
};
2 changes: 1 addition & 1 deletion lib/createOutputStream/writeStream.js
Original file line number Diff line number Diff line change
@@ -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(){
Expand Down

0 comments on commit c196935

Please sign in to comment.