From 3f97fe875f9a6b5d0ba783f596e4236f806a03a3 Mon Sep 17 00:00:00 2001 From: jbondc Date: Thu, 19 Feb 2015 16:06:46 -0500 Subject: [PATCH] Wrap all commands in exec() --- Jakefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Jakefile b/Jakefile index dfac39321e8..7f8739f2439 100644 --- a/Jakefile +++ b/Jakefile @@ -232,10 +232,9 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu var cmd = host + " " + dir + compilerFilename + " " + options + " "; cmd = cmd + sources.join(" "); - console.log(cmd + "\n"); - var ex = jake.createExec([cmd], {interactive: true}); - ex.addListener("cmdEnd", function() { + exec(cmd, function() { + console.log("") if (!useDebugMode && prefixes && fs.existsSync(outFile)) { for (var i in prefixes) { prependFile(prefixes[i], outFile); @@ -247,12 +246,11 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu } else { complete(); } - }); - ex.addListener("error", function() { + }, /* errorHandler */ function() { fs.unlinkSync(outFile); fail("Compilation of " + outFile + " unsuccessful"); }); - ex.run(); + }, {async: true}); } @@ -457,7 +455,7 @@ var refTest262Baseline = path.join(internalTests, "baselines/test262/reference") desc("Builds the test infrastructure using the built compiler"); task("tests", ["local", run].concat(libraryTargets)); -function exec(cmd, completeHandler) { +function exec(cmd, completeHandler, errorHandler) { console.log(cmd); var ex = jake.createExec([cmd], {windowsVerbatimArguments: true, interactive: true}); ex.addListener("cmdEnd", function() { @@ -467,7 +465,7 @@ function exec(cmd, completeHandler) { complete(); } }); - ex.addListener("error", function(e, status) { + ex.addListener("error", errorHandler ? errorHandler : function(e, status) { fail("Process exited with code " + status); })