Skip to content

Commit 29137f1

Browse files
committed
Require non-null pipeOutputToTool
1 parent 58ee961 commit 29137f1

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

node/task.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ export function rmRF(path: string): void {
11991199
*/
12001200
export function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Promise<number> {
12011201
let tr: trm.ToolRunner = this.tool(tool);
1202-
tr.on('debug', (data) => {
1202+
tr.on('debug', (data: string) => {
12031203
debug(data);
12041204
});
12051205

node/toolrunner.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ export class ToolRunner extends events.EventEmitter {
496496
return result;
497497
}
498498

499-
private execWithPiping(options?: IExecOptions): Q.Promise<number> {
499+
private execWithPiping(pipeOutputToTool: ToolRunner, options?: IExecOptions): Q.Promise<number> {
500500
var defer = Q.defer<number>();
501501

502502
this._debug('exec tool: ' + this.toolPath);
@@ -505,12 +505,6 @@ export class ToolRunner extends events.EventEmitter {
505505
this._debug(' ' + arg);
506506
});
507507

508-
// This is a private method, and must be called only when `this.pipeOutputToTool` is set
509-
if (!this.pipeOutputToTool) {
510-
throw new Error('You must call pipeExecOutputToTool before calling execWithPiping');
511-
}
512-
const pipeOutputToTool = this.pipeOutputToTool;
513-
514508
let success = true;
515509
const optionsNonNull = this._cloneExecOptions(options);
516510

@@ -783,7 +777,7 @@ export class ToolRunner extends events.EventEmitter {
783777
*/
784778
public exec(options?: IExecOptions): Q.Promise<number> {
785779
if (this.pipeOutputToTool) {
786-
return this.execWithPiping(options);
780+
return this.execWithPiping(this.pipeOutputToTool, options);
787781
}
788782

789783
var defer = Q.defer<number>();

0 commit comments

Comments
 (0)