1026
1027
export function from(this: void, config: ICommandConfigurationShape, context: IParseContext): Tasks.ICommandConfiguration | undefined {
1029
>
1030
>
let osConfig: Tasks.ICommandConfiguration | undefined = undefined;
1031
>
if (config.windows && context.platform === Platform.Windows) {
1032
osConfig = fromBase(config.windows, context);
1034
osConfig = fromBase(config.osx, context);
1036
osConfig = fromBase(config.linux, context);
1037
}
1039
result = assignProperties(result, osConfig, context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0);
1040
}
1042
>
}
1043
1044
function fromBase(this: void, config: IBaseCommandConfigurationShape, context: IParseContext): Tasks.ICommandConfiguration | undefined {
1045
>
const name: Tasks.CommandString | undefined = ShellString.from(config.command);
taskConfiguration.ts
1046
>
let runtime: Tasks.RuntimeType;
1047
>
if (Types.isString(config.type)) {
1048
if (config.type === 'shell' || config.type === 'process') {
1049
runtime = Tasks.RuntimeType.fromString(config.type);
1050
}
1051
}
1052
>
if (Types.isBoolean(config.isShellCommand) || ShellConfiguration.is(config.isShellCommand)) {
taskConfiguration.ts
1053
runtime = Tasks.RuntimeType.Shell;
1055
runtime = !!config.isShellCommand ? Tasks.RuntimeType.Shell : Tasks.RuntimeType.Process;
1056
}
1058
>
const result: Tasks.ICommandConfiguration = {
1059
>
name: name,
1060
>
runtime: runtime!,
1061
>
presentation: PresentationOptions.from(config, context)!
1062
>
};
1063
>
1064
>
if (config.args !== undefined) {
1065
result.args = [];
1066
for (const arg of config.args) {