提交 8469eadf 编写于 作者: D Dirk Baeumer

Fixes 47317: Can't use long commands in tasks. Used to work in previous release.

上级 5d12f531
......@@ -152,14 +152,36 @@ const taskType: IJSONSchema = {
const command: IJSONSchema = {
oneOf: [
{
type: 'string',
oneOf: [
{
type: 'string'
},
{
type: 'array',
items: {
type: 'string'
},
description: nls.localize('JsonSchema.commandArray', 'The shell command to be executed. Array items will be joined using a space character')
}
]
},
{
type: 'object',
required: ['value', 'quoting'],
properties: {
value: {
type: 'string',
oneOf: [
{
type: 'string'
},
{
type: 'array',
items: {
type: 'string'
},
description: nls.localize('JsonSchema.commandArray', 'The shell command to be executed. Array items will be joined using a space character')
}
],
description: nls.localize('JsonSchema.command.quotedString.value', 'The actual command value')
},
quoting: {
......
......@@ -182,14 +182,20 @@ export interface LegacyCommandProperties {
isShellCommand?: boolean | ShellConfiguration;
}
export type CommandString = string | { value: string, quoting: 'escape' | 'strong' | 'weak' };
export type CommandString = string | string[] | { value: string | string[], quoting: 'escape' | 'strong' | 'weak' };
export namespace CommandString {
export function value(value: CommandString): string {
if (Types.isString(value)) {
return value;
} else if (Types.isStringArray(value)) {
return value.join(' ');
} else {
if (Types.isString(value.value)) {
return value.value;
} else {
return value.value.join(' ');
}
}
}
}
......@@ -787,16 +793,22 @@ namespace CommandConfiguration {
}
if (Types.isString(value)) {
return value;
}
if (Types.isString(value.value)) {
} else if (Types.isStringArray(value)) {
return value.join(' ');
} else {
let quoting = Tasks.ShellQuoting.from(value.quoting);
let result = Types.isString(value.value) ? value.value : Types.isStringArray(value.value) ? value.value.join(' ') : undefined;
if (result) {
return {
value: value.value,
quoting: Tasks.ShellQuoting.from(value.quoting)
value: result,
quoting: quoting
};
}
} else {
return undefined;
}
}
}
}
interface BaseCommandConfiguationShape extends BaseCommandProperties, LegacyCommandProperties {
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册