Skip to content

Commit 53b954f

Browse files
graycarlDonJayamanne
authored andcommitted
Fix spawn args (#489)
Fix fail to generate ctags when there is a space in the path. like #44 #146. We don't need to handle space in the path when the path is passed to child_process.spawn as 'args' (not as the command).
1 parent 8f97908 commit 53b954f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/client/workspaceSymbols/generator.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ export class Generator implements vscode.Disposable {
3333
return await this.generateTags({ directory: this.workspaceFolder.fsPath });
3434
}
3535
private buildCmdArgs(): string[] {
36-
const optionsFile = this.optionsFile.indexOf(' ') > 0 ? `"${this.optionsFile}"` : this.optionsFile;
3736
const exclusions = this.pythonSettings.workspaceSymbols.exclusionPatterns;
3837
const excludes = exclusions.length === 0 ? [] : exclusions.map(pattern => `--exclude=${pattern}`);
3938

40-
return [`--options=${optionsFile}`, '--languages=Python'].concat(excludes);
39+
return [`--options=${this.optionsFile}`, '--languages=Python'].concat(excludes);
4140
}
4241
@captureTelemetry(WORKSPACE_SYMBOLS_BUILD)
4342
private generateTags(source: { directory?: string, file?: string }): Promise<void> {
@@ -57,8 +56,7 @@ export class Generator implements vscode.Disposable {
5756
if (!fs.existsSync(outputDir)) {
5857
fs.mkdirSync(outputDir);
5958
}
60-
outputFile = outputFile.indexOf(' ') > 0 ? `"${outputFile}"` : outputFile;
61-
args.push(`-o ${outputFile}`, '.');
59+
args.push('-o', outputFile, '.');
6260
this.output.appendLine(`${'-'.repeat(10)}Generating Tags${'-'.repeat(10)}`);
6361
this.output.appendLine(`${cmd} ${args.join(' ')}`);
6462
const promise = new Promise<void>((resolve, reject) => {

0 commit comments

Comments
 (0)