Skip to content

Commit 233f88c

Browse files
author
jbondc
committed
Use exec() more consistently.
1 parent d8c85b3 commit 233f88c

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

Jakefile

+5-24
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,9 @@ compileFile(processDiagnosticMessagesJs,
297297
file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson], function () {
298298
var cmd = "node " + processDiagnosticMessagesJs + " " + diagnosticMessagesJson;
299299
console.log(cmd);
300-
var ex = jake.createExec([cmd]);
301-
// Add listeners for output and error
302-
ex.addListener("stdout", function(output) {
303-
process.stdout.write(output);
304-
});
305-
ex.addListener("stderr", function(error) {
306-
process.stderr.write(error);
307-
});
308-
ex.addListener("cmdEnd", function() {
300+
exec(cmd, function() {
309301
complete();
310302
});
311-
ex.run();
312303
}, {async: true})
313304

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

471462
function exec(cmd, completeHandler) {
472-
var ex = jake.createExec([cmd], {windowsVerbatimArguments: true});
473-
// Add listeners for output and error
474-
ex.addListener("stdout", function(output) {
475-
process.stdout.write(output);
476-
});
477-
ex.addListener("stderr", function(error) {
478-
process.stderr.write(error);
479-
});
463+
var ex = jake.createExec([cmd], {windowsVerbatimArguments: true, interactive: true});
480464
ex.addListener("cmdEnd", function() {
481465
if (completeHandler) {
482466
completeHandler();
@@ -670,13 +654,12 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
670654
var options = "--outdir " + temp + ' ' + loggedIOpath;
671655
var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " ";
672656
console.log(cmd + "\n");
673-
var ex = jake.createExec([cmd]);
674-
ex.addListener("cmdEnd", function() {
657+
658+
exec(cmd, function() {
675659
fs.renameSync(temp + '/harness/loggedIO.js', loggedIOJsPath);
676660
jake.rmRf(temp);
677661
complete();
678662
});
679-
ex.run();
680663
}, {async: true});
681664

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

0 commit comments

Comments
 (0)