Created
October 14, 2016 14:19
-
-
Save XOP/f43f2f7dd6ca82f5083dd9164d495e1b to your computer and use it in GitHub Desktop.
Node CLI runner
This file contains hidden or 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
#!/usr/bin/env node | |
"use strict"; | |
var log = require('log-util'); | |
var exec = require('child_process').exec; | |
module.exports = function (cmd) { | |
var command = 'npm run ' + cmd; | |
exec( | |
command, | |
function (error, stdout, stderr) { | |
if (error) { | |
log.error('exec error: ' + error); | |
} | |
log.verbose(stdout); | |
log.error(stderr); | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment