Skip to content

Commit 64605eb

Browse files
committed
Annotate optional properties on IExecOptions
1 parent 29137f1 commit 64605eb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

node/mock-toolrunner.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function setAnswers(answers: ma.TaskLibAnswers) {
1111
mock.initialize(answers);
1212
}
1313

14-
var run = function(cmd, callback) {
14+
var run = function(cmd, callback) {F
1515
console.log('running: ' + cmd);
1616
var output = '';
1717
try {
@@ -24,17 +24,17 @@ var run = function(cmd, callback) {
2424
}
2525

2626
export interface IExecOptions extends IExecSyncOptions {
27-
failOnStdErr: boolean;
28-
ignoreReturnCode: boolean;
27+
failOnStdErr?: boolean;
28+
ignoreReturnCode?: boolean;
2929
};
3030

3131
export interface IExecSyncOptions {
32-
cwd: string;
33-
env: { [key: string]: string };
34-
silent: boolean;
32+
cwd?: string;
33+
env?: { [key: string]: string };
34+
silent?: boolean;
3535
outStream: NodeJS.WritableStream;
3636
errStream: NodeJS.WritableStream;
37-
windowsVerbatimArguments: boolean;
37+
windowsVerbatimArguments?: boolean;
3838
};
3939

4040
export interface IExecSyncResult {

node/toolrunner.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ import fs = require('fs');
1313
*/
1414
export interface IExecOptions extends IExecSyncOptions {
1515
/** optional. whether to fail if output to stderr. defaults to false */
16-
failOnStdErr: boolean;
16+
failOnStdErr?: boolean;
1717

1818
/** optional. defaults to failing on non zero. ignore will not fail leaving it up to the caller */
19-
ignoreReturnCode: boolean;
19+
ignoreReturnCode?: boolean;
2020
}
2121

2222
/**
2323
* Interface for execSync options
2424
*/
2525
export interface IExecSyncOptions {
2626
/** optional working directory. defaults to current */
27-
cwd: string;
27+
cwd?: string;
2828

2929
/** optional envvar dictionary. defaults to current process's env */
30-
env: { [key: string]: string };
30+
env?: { [key: string]: string };
3131

3232
/** optional. defaults to false */
33-
silent: boolean;
33+
silent?: boolean;
3434

3535
outStream: stream.Writable;
3636

3737
errStream: stream.Writable;
3838

3939
/** optional. foo.whether to skip quoting/escaping arguments if needed. defaults to false. */
40-
windowsVerbatimArguments: boolean;
40+
windowsVerbatimArguments?: boolean;
4141
}
4242

4343
/**

0 commit comments

Comments
 (0)