Skip to content

Commit

Permalink
Merge pull request #143 from AnouarTouati/parser-windows-path
Browse files Browse the repository at this point in the history
Fixes: Can't find parser binary on windows when path has spaces
  • Loading branch information
joetannenbaum authored Jan 3, 2025
2 parents 69af8e7 + 8b68711 commit fe8691e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/support/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const setParserBinaryPath = (context: vscode.ExtensionContext) => {
downloadBinary(context).then((path) => {
if (path) {
parserBinaryPath = process.env.PHP_PARSER_BINARY_PATH || path;
parserBinaryPath = path.replace(" ", "\\ ");
}
});
};
Expand Down Expand Up @@ -170,7 +169,7 @@ const runCommand = (command: string): Promise<string> => {
}

const extraArgs = os.platform() === "win32" ? "--from-file" : "";
const toRun = `${parserBinaryPath} ${command} ${extraArgs}`;
const toRun = `"${parserBinaryPath}" ${command} ${extraArgs}`;

// console.log("running command", toRun);

Expand Down

0 comments on commit fe8691e

Please sign in to comment.