Skip to content

Instantly share code, notes, and snippets.

@jreading
Last active December 19, 2015 16:39
Show Gist options
  • Save jreading/5985516 to your computer and use it in GitHub Desktop.
Save jreading/5985516 to your computer and use it in GitHub Desktop.
Simple node script for running installs
var exec = require('child_process').exec;
var commands = ['npm install', 'bower install'];
var command = 0;
var run = function(cmd){
console.log('running > ' + cmd);
var child = exec(cmd, function (error, stdout, stderr) {
if (stderr !== null) {
console.log(stderr);
}
if (stdout !== null) {
console.log(stdout);
}
if (error !== null) {
console.log(error);
}
command++;
if (command < commands.length) {
run(commands[command]);
}
});
};
run(commands[command]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment