Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Last active June 16, 2016 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattpodwysocki/96414ba6150dec7ecfcf9cfe3600f236 to your computer and use it in GitHub Desktop.
Save mattpodwysocki/96414ba6150dec7ecfcf9cfe3600f236 to your computer and use it in GitHub Desktop.
'use strict';
const exec = require('child_process').exec;
function execCommand(cmd, options) {
return new Promise((resolve, reject) => {
exec(cmd, options, function (err, stdout, stderr) {
if (err) {
reject(err);
} else {
resolve(stdout);
}
})
});
}
module.exports = execCommand;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment