Allow tasks without a command

Fixes #70511
This commit is contained in:
Alex Ross 2019-03-15 18:41:09 +01:00
parent 93c77d5286
commit ea7c31d770

View file

@ -597,27 +597,28 @@ export class CustomTask extends CommonTask {
return this._source.customizes;
} else {
let type: string;
if (this.command !== undefined) {
switch (this.command.runtime) {
case RuntimeType.Shell:
type = 'shell';
break;
const commandRuntime = this.command ? this.command.runtime : undefined;
switch (commandRuntime) {
case RuntimeType.Shell:
type = 'shell';
break;
case RuntimeType.Process:
type = 'process';
break;
case RuntimeType.Process:
type = 'process';
break;
case RuntimeType.CustomExecution:
type = 'customExecution';
break;
case RuntimeType.CustomExecution:
type = 'customExecution';
break;
default:
throw new Error('Unexpected task runtime');
break;
}
} else {
type = '$composite';
case undefined:
type = '$composite';
break;
default:
throw new Error('Unexpected task runtime');
}
let result: KeyedTaskIdentifier = {
type,
_key: this._id,