Skip to content

Commit

Permalink
Fixes #19. Callback in mv method is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
richardgirges committed Feb 17, 2017
1 parent 568f211 commit df3df26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ module.exports = function(options) {
safeFileNameRegex = options.safeFileNames;

filename = filename.replace(safeFileNameRegex, '');

console.log('filename yo', filename);
}

var newFile = {
Expand All @@ -63,10 +61,12 @@ module.exports = function(options) {
fstream = fs.createWriteStream(path);
streamifier.createReadStream(buf).pipe(fstream);
fstream.on('error', function(error) {
callback(error);
if (callback)
callback(error);
});
fstream.on('close', function() {
callback(null);
if (callback)
callback(null);
});
}
};
Expand Down

0 comments on commit df3df26

Please sign in to comment.