Skip to content

Commit b01ffcf

Browse files
committed
Fixes microsoft#28489: Bug with tasks in realease 1.13
1 parent 46843c3 commit b01ffcf

2 files changed

Lines changed: 43 additions & 15 deletions

File tree

src/vs/workbench/parts/tasks/node/taskConfiguration.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -854,26 +854,28 @@ namespace CommandConfiguration {
854854
runtime: undefined,
855855
presentation: undefined
856856
};
857-
fillProperty(target, source, 'name');
857+
if (target.name === void 0) {
858+
fillProperty(target, source, 'name');
859+
fillProperty(target, source, 'taskSelector');
860+
fillProperty(target, source, 'suppressTaskName');
861+
let args: string[] = source.args ? source.args.slice() : [];
862+
if (!target.suppressTaskName) {
863+
if (target.taskSelector !== void 0) {
864+
args.push(target.taskSelector + taskName);
865+
} else {
866+
args.push(taskName);
867+
}
868+
}
869+
if (target.args) {
870+
args = args.concat(target.args);
871+
}
872+
target.args = args;
873+
}
858874
fillProperty(target, source, 'runtime');
859-
fillProperty(target, source, 'taskSelector');
860-
fillProperty(target, source, 'suppressTaskName');
861875

862876
target.presentation = PresentationOptions.fillProperties(target.presentation, source.presentation);
863877
target.options = CommandOptions.fillProperties(target.options, source.options);
864878

865-
let args: string[] = source.args ? source.args.slice() : [];
866-
if (!target.suppressTaskName) {
867-
if (target.taskSelector !== void 0) {
868-
args.push(target.taskSelector + taskName);
869-
} else {
870-
args.push(taskName);
871-
}
872-
}
873-
if (target.args) {
874-
args = args.concat(target.args);
875-
}
876-
target.args = args;
877879
return target;
878880
}
879881

src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,4 +1530,30 @@ suite('Bugs / regression tests', () => {
15301530
testConfiguration(external, builder);
15311531
}
15321532
});
1533+
1534+
test('Bug 28489', () => {
1535+
let external = {
1536+
version: '0.1.0',
1537+
command: '',
1538+
isShellCommand: true,
1539+
args: [''],
1540+
showOutput: 'always',
1541+
'tasks': [
1542+
{
1543+
taskName: 'build',
1544+
command: 'bash',
1545+
args: [
1546+
'build.sh'
1547+
]
1548+
}
1549+
]
1550+
};
1551+
let builder = new ConfiguationBuilder();
1552+
builder.task('build', 'bash').
1553+
group(Tasks.TaskGroup.Build).
1554+
command().suppressTaskName(true).
1555+
args(['build.sh']).
1556+
runtime(Tasks.RuntimeType.Shell);
1557+
testConfiguration(external, builder);
1558+
});
15331559
});

0 commit comments

Comments
 (0)