Skip to content

Commit

Permalink
Use exec() more consistently.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbondc committed Feb 16, 2015
1 parent d8c85b3 commit 233f88c
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions Jakefile
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,9 @@ compileFile(processDiagnosticMessagesJs,
file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson], function () {
var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson;
console.log(cmd);
var ex = jake.createExec([cmd]);
// Add listeners for output and error
ex.addListener("stdout", function(output) {
process.stdout.write(output);
});
ex.addListener("stderr", function(error) {
process.stderr.write(error);
});
ex.addListener("cmdEnd", function() {
exec(cmd, function() {
complete();
});
ex.run();
}, {async: true})

desc("Generates a diagnostic file in TypeScript based on an input JSON file");
Expand Down Expand Up @@ -469,14 +460,7 @@ desc("Builds the test infrastructure using the built compiler");
task("tests", ["local", run].concat(libraryTargets));

function exec(cmd, completeHandler) {
var ex = jake.createExec([cmd], {windowsVerbatimArguments: true});
// Add listeners for output and error
ex.addListener("stdout", function(output) {
process.stdout.write(output);
});
ex.addListener("stderr", function(error) {
process.stderr.write(error);
});
var ex = jake.createExec([cmd], {windowsVerbatimArguments: true, interactive: true});
ex.addListener("cmdEnd", function() {
if (completeHandler) {
completeHandler();
Expand Down Expand Up @@ -670,13 +654,12 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
var options = "--outdir " + temp + ' ' + loggedIOpath;
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
console.log(cmd + "\n");
var ex = jake.createExec([cmd]);
ex.addListener("cmdEnd", function() {

exec(cmd, function() {
fs.renameSync(temp + '/harness/loggedIO.js', loggedIOJsPath);
jake.rmRf(temp);
complete();
});
ex.run();
}, {async: true});

var instrumenterPath = harnessDirectory + 'instrumenter.ts';
Expand All @@ -687,9 +670,7 @@ desc("Builds an instrumented tsc.js");
task('tsc-instrumented', [loggedIOJsPath, instrumenterJsPath, tscFile], function() {
var cmd = host + ' ' + instrumenterJsPath + ' record iocapture ' + builtLocalDirectory + compilerFilename;
console.log(cmd);
var ex = jake.createExec([cmd]);
ex.addListener("cmdEnd", function() {
exec(cmd, function() {
complete();
});
ex.run();
}, { async: true });

0 comments on commit 233f88c

Please sign in to comment.