mirror of
https://git.coastit.co.za/caitlin/CRM_ENVR.git
synced 2026-07-10 11:15:43 +02:00
Attachment fixed
This commit is contained in:
@@ -6,8 +6,21 @@
|
||||
|
||||
import { execSync, spawn } from "node:child_process"
|
||||
import { platform } from "node:os"
|
||||
import { statSync } from "node:fs"
|
||||
|
||||
function detectPython() {
|
||||
const commonPaths = [
|
||||
`${process.env.LOCALAPPDATA}\\Programs\\Python\\Python313\\python.exe`,
|
||||
`${process.env.LOCALAPPDATA}\\Programs\\Python\\Python312\\python.exe`,
|
||||
`${process.env.ProgramFiles}\\Python313\\python.exe`,
|
||||
`${process.env.ProgramFiles}\\Python312\\python.exe`,
|
||||
]
|
||||
for (const p of commonPaths) {
|
||||
try {
|
||||
statSync(p)
|
||||
return p
|
||||
} catch {}
|
||||
}
|
||||
const candidates = platform() === "win32" ? ["python", "python3"] : ["python3", "python"]
|
||||
for (const cmd of candidates) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user