Last active
June 16, 2016 18:34
-
-
Save mattpodwysocki/96414ba6150dec7ecfcf9cfe3600f236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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