Skip to content

Commit

Permalink
feat(step): add new move step
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk committed Oct 10, 2017
1 parent 5391005 commit d9256f4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/step/move.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');

module.exports = ({move} = null, stream) => {
if (!move) {
return stream;
}

return new Promise((resolve, reject) => {
fs.rename(move.sourceFile, move.targetFile, error => {
if (error) {
return reject(error);
}

resolve(stream);
})
});
};

0 comments on commit d9256f4

Please sign in to comment.