Skip to content

Commit

Permalink
Fix pythonHelper version command for non-windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Oct 31, 2024
1 parent 9ca0df0 commit b182924
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/pythonHelper.mts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ export default async function findPython(): Promise<string | undefined> {
// check if it actually exists and is a supported version
if (existsSync(pythonPath)) {
try {
const version = execSync(`&"${pythonPath}" -V`, {
const version = execSync(`${
process.env.ComSpec === "powershell.exe" ? "&" : ""
}"${pythonPath}" -V`, {
encoding: "utf-8",
shell: process.platform === "win32" ? "powershell" : undefined,
timeout: 1000,
windowsHide: true,
maxBuffer: 1024,
Expand Down

0 comments on commit b182924

Please sign in to comment.