Skip to content

Commit ca80d6a

Browse files
anthonykim1Copilot
andauthored
Fix regression package.json task fail to re-run (#286230)
* Fix regression package.json task fail to re-run * Update src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * revert copilot changes * check for 1 or 127 for command not found * Check to see if exitCode is none zero when showing warning * Update to only watch for 1 or 127 * use !success || (success.exitCode !== undefined && success.exitCode !== 0) * Use typeof success.exitCode number --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8bb40dd commit ca80d6a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,8 +2190,11 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
21902190
if (updatedTask) {
21912191
await this.run(updatedTask);
21922192
} else {
2193-
// Task no longer exists, show warning
2194-
this._notificationService.warn(nls.localize('TaskSystem.taskNoLongerExists', 'Task {0} no longer exists or has been modified. Cannot restart.', task.configurationProperties.name));
2193+
const success = await this.run(task);
2194+
if (!success || (typeof success.exitCode === 'number' && success.exitCode !== 0)) {
2195+
// Task no longer exists, show warning
2196+
this._notificationService.warn(nls.localize('TaskSystem.taskNoLongerExists', 'Task {0} no longer exists or has been modified. Cannot restart.', task.configurationProperties.name));
2197+
}
21952198
}
21962199
} catch {
21972200
// eat the error, we don't care about it here

0 commit comments

Comments
 (0)