Skip to content

Commit c41d076

Browse files
committed
for saxonJS tasks - use processExecution instead of shellExecution
1 parent ddb2bf0 commit c41d076

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/saxonJsTaskProvider.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class SaxonJsTaskProvider implements vscode.TaskProvider {
143143
let xsltParameters: XSLTParameter[] = xsltTask.parameters? xsltTask.parameters: [];
144144
let xsltParametersCommand: string[] = []
145145
for (const param of xsltParameters) {
146-
xsltParametersCommand.push('"' + param.name + '=' + param.value + '"');
146+
xsltParametersCommand.push(param.name + '=' + param.value);
147147
}
148148

149149
for (const propName in xsltTask) {
@@ -170,25 +170,19 @@ export class SaxonJsTaskProvider implements vscode.TaskProvider {
170170
break;
171171
}
172172
if (propNameValue !== '') {
173-
const escapedArg = SaxonTaskProvider.escapeString2(propNameValue);
174-
commandLineArgs.push(escapedArg);
173+
commandLineArgs.push(propNameValue);
175174
}
176175
}
177176

178177
let nodeModulesPath = xsltTask.nodeModulesFolder + path.sep + '.bin' + path.sep;
179178

180-
if (xsltParametersCommand.length > 0) {
181-
commandLineArgs.push(xsltParametersCommand.join(' '));
182-
}
183-
184-
let resolvedCommandLine = commandLineArgs.join(' ');
185179
// this is overriden if problemMatcher is set in the tasks.json file
186180
let problemMatcher = "$saxon-xslt-js";
187-
let escapedModulesPath = SaxonTaskProvider.escapeString(nodeModulesPath + 'xslt3');
188-
let commandline = `${escapedModulesPath} ${resolvedCommandLine}`;
189-
console.log('commandline:');
190-
console.log(commandline);
191-
let newTask = new vscode.Task(xsltTask, xsltTask.label, source, new vscode.ShellExecution(commandline), problemMatcher);
181+
182+
const processExecution = new vscode.ProcessExecution(nodeModulesPath + 'xslt3', commandLineArgs.concat(xsltParametersCommand));
183+
let newTask = new vscode.Task(xsltTask, xsltTask.label, source, processExecution, problemMatcher);
184+
185+
//let newTask = new vscode.Task(xsltTask, xsltTask.label, source, new vscode.ShellExecution(commandline), problemMatcher);
192186
return newTask;
193187
} else {
194188
return undefined;

0 commit comments

Comments
 (0)