Skip to content

Commit 90a65a2

Browse files
authored
Set shell: true for all commands (#400)
We need to set `shell: true` for all commands being run by the extension, because they should be executed in a shell environment. This allows for interpreting `"`, for example, in the file path correctly.
1 parent a67c736 commit 90a65a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/buf.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ export const lint = (
3232
binaryPath,
3333
[
3434
"lint",
35-
`"${filePath}"` + "#include_package_files=true",
35+
`'${filePath}'` + "#include_package_files=true",
3636
"--error-format=json",
3737
],
3838
{
3939
encoding: "utf-8",
4040
cwd: cwd,
41-
shell: process.platform === "win32",
41+
shell: true,
4242
}
4343
);
4444
// If the command fails to run, such as a failed module/workspace build, return the error.
@@ -55,7 +55,7 @@ export const lint = (
5555
export const version = (binaryPath: string): Version | Error => {
5656
const output = child_process.spawnSync(binaryPath, ["--version"], {
5757
encoding: "utf-8",
58-
shell: process.platform === "win32",
58+
shell: true,
5959
});
6060
if (output.error !== undefined) {
6161
return { errorMessage: output.error.message };

0 commit comments

Comments
 (0)