Skip to content

Commit

Permalink
Fix spawn args (#489)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
graycarl authored and DonJayamanne committed Jan 4, 2018
1 parent 8f97908 commit 53b954f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/client/workspaceSymbols/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ export class Generator implements vscode.Disposable {
return await this.generateTags({ directory: this.workspaceFolder.fsPath });
}
private buildCmdArgs(): string[] {
const optionsFile = this.optionsFile.indexOf(' ') > 0 ? `"${this.optionsFile}"` : this.optionsFile;
const exclusions = this.pythonSettings.workspaceSymbols.exclusionPatterns;
const excludes = exclusions.length === 0 ? [] : exclusions.map(pattern => `--exclude=${pattern}`);

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

0 comments on commit 53b954f

Please sign in to comment.