提交 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 = { ...@@ -152,14 +152,36 @@ const taskType: IJSONSchema = {
const command: IJSONSchema = { const command: IJSONSchema = {
oneOf: [ 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', type: 'object',
required: ['value', 'quoting'], required: ['value', 'quoting'],
properties: { properties: {
value: { 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') description: nls.localize('JsonSchema.command.quotedString.value', 'The actual command value')
}, },
quoting: { quoting: {
......
...@@ -182,14 +182,20 @@ export interface LegacyCommandProperties { ...@@ -182,14 +182,20 @@ export interface LegacyCommandProperties {
isShellCommand?: boolean | ShellConfiguration; 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 namespace CommandString {
export function value(value: CommandString): string { export function value(value: CommandString): string {
if (Types.isString(value)) { if (Types.isString(value)) {
return value; return value;
} else if (Types.isStringArray(value)) {
return value.join(' ');
} else { } else {
return value.value; if (Types.isString(value.value)) {
return value.value;
} else {
return value.value.join(' ');
}
} }
} }
} }
...@@ -787,14 +793,20 @@ namespace CommandConfiguration { ...@@ -787,14 +793,20 @@ namespace CommandConfiguration {
} }
if (Types.isString(value)) { if (Types.isString(value)) {
return value; return 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: result,
quoting: quoting
};
} else {
return undefined;
}
} }
if (Types.isString(value.value)) {
return {
value: value.value,
quoting: Tasks.ShellQuoting.from(value.quoting)
};
}
return undefined;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册