Created
February 14, 2012 22:27
-
-
Save gigafied/1831065 to your computer and use it in GitHub Desktop.
Lots of execs in node
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 commands = []; | |
commands.push("git -v"); | |
commands.push("git -v"); | |
commands.push("git -v"); | |
commands.push("git -v"); | |
commands.push("git -v"); | |
commands.push("git -v"); | |
commands.push("git -v"); | |
function execComplete () { | |
if (commands.length) { | |
var cmd = commands.shift(); | |
exec(cmd, execComplete); | |
} | |
else{ | |
// All commands executed... | |
} | |
} | |
execComplete(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment