Created
December 16, 2009 16:00
-
-
Save ryanmcgrath/257942 to your computer and use it in GitHub Desktop.
This file contains 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 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