Skip to content

Commit b182924

Browse files
committed
Fix pythonHelper version command for non-windows systems
1 parent 9ca0df0 commit b182924

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/pythonHelper.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ export default async function findPython(): Promise<string | undefined> {
4646
// check if it actually exists and is a supported version
4747
if (existsSync(pythonPath)) {
4848
try {
49-
const version = execSync(`&"${pythonPath}" -V`, {
49+
const version = execSync(`${
50+
process.env.ComSpec === "powershell.exe" ? "&" : ""
51+
}"${pythonPath}" -V`, {
5052
encoding: "utf-8",
51-
shell: process.platform === "win32" ? "powershell" : undefined,
5253
timeout: 1000,
5354
windowsHide: true,
5455
maxBuffer: 1024,

0 commit comments

Comments
 (0)