Skip to content

Instantly share code, notes, and snippets.

@ryanmcgrath
Created December 16, 2009 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmcgrath/257942 to your computer and use it in GitHub Desktop.
Save ryanmcgrath/257942 to your computer and use it in GitHub Desktop.
var sys = require("sys"),
currPath = process.cwd();
var buildCommands = [
{dir: "", cmd: ""},
{dir: "", cmd: ""},
{dir: "", cmd: ""},
{dir: "", cmd: ""}
];
function runMavenBuild(runArrayCmd) {
sys.puts("Going into " + buildCommands[runArrayCmd].dir + ", running: " + buildCommands[runArrayCmd].cmd);
process.chdir(buildCommands[runArrayCmd].dir);
sys.exec(buildCommands[runArrayCmd].cmd).addCallback(function(stdout, stderr) {
sys.puts(stderr);
sys.puts(stdout);
if(stdout.match("FAILURE") === null || stdout.match("FAILED") === null) {
if(runArrayCmd < buildCommands.length - 1) runMavenBuild(runArrayCmd + 1);
else process.chdir(currPath);
}
});
}
runMavenBuild(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment