Skip to content

Commit

Permalink
IMPLEMENT EXECUTE HELPER
Browse files Browse the repository at this point in the history
Helper method to wrap `childProcess.exec` in a promise
  • Loading branch information
kareemaly committed Nov 11, 2017
1 parent fa3be79 commit 3cfbd2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/execute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import childProcess from 'child_process';

export default command => new Promise((resolve, reject) => {
childProcess.exec(command, (err, out) => {
if (err) {
return reject(err);
}

return resolve(out);
});
});

0 comments on commit 3cfbd2c

Please sign in to comment.