Last active
December 19, 2015 16:39
-
-
Save jreading/5985516 to your computer and use it in GitHub Desktop.
Simple node script for running installs
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
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