Skip to content

Commit

Permalink
set done when calling setResult (#8462)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple authored Oct 1, 2018
1 parent 91f6d06 commit ee28059
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 44 deletions.
12 changes: 9 additions & 3 deletions Tasks/BashV3/bash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,24 @@ async function run() {
// Run bash.
let exitCode: number = await bash.exec(options);

let result = tl.TaskResult.Succeeded;

// Fail on exit code.
if (exitCode !== 0) {
tl.setResult(tl.TaskResult.Failed, tl.loc('JS_ExitCode', exitCode));
tl.error(tl.loc('JS_ExitCode', exitCode));
result = tl.TaskResult.Failed;
}

// Fail on stderr.
if (stderrFailure) {
tl.setResult(tl.TaskResult.Failed, tl.loc('JS_Stderr'));
tl.error(tl.loc('JS_Stderr'));
result = tl.TaskResult.Failed;
}

tl.setResult(result, null, true);
}
catch (err) {
tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed');
tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed', true);
}
}

Expand Down
32 changes: 16 additions & 16 deletions Tasks/BashV3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/BashV3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {
"uuid": "^3.0.1",
"vsts-task-lib": "2.0.5"
"vsts-task-lib": "2.7.0"
}
}
2 changes: 1 addition & 1 deletion Tasks/BashV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 3,
"Minor": 136,
"Minor": 142,
"Patch": 0
},
"releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/BashV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 3,
"Minor": 136,
"Minor": 142,
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down
12 changes: 9 additions & 3 deletions Tasks/CmdLineV2/cmdline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ async function run() {
// Run bash.
let exitCode: number = await bash.exec(options);

let result = tl.TaskResult.Succeeded;

// Fail on exit code.
if (exitCode !== 0) {
tl.setResult(tl.TaskResult.Failed, tl.loc('JS_ExitCode', exitCode));
tl.error(tl.loc('JS_ExitCode', exitCode));
result = tl.TaskResult.Failed;
}

// Fail on stderr.
if (stderrFailure) {
tl.setResult(tl.TaskResult.Failed, tl.loc('JS_Stderr'));
tl.error(tl.loc('JS_Stderr'));
result = tl.TaskResult.Failed;
}

tl.setResult(result, null, true);
}
catch (err) {
tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed');
tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed', true);
}
}

Expand Down
32 changes: 16 additions & 16 deletions Tasks/CmdLineV2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/CmdLineV2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {
"uuid": "^3.0.1",
"vsts-task-lib": "2.0.5"
"vsts-task-lib": "2.7.0"
}
}
2 changes: 1 addition & 1 deletion Tasks/CmdLineV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 136,
"Minor": 142,
"Patch": 0
},
"releaseNotes": "Script task consistency. Added support for multiple lines.",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/CmdLineV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 136,
"Minor": 142,
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down

0 comments on commit ee28059

Please sign in to comment.