This commit is contained in:
Koushik Dutta
2023-06-08 08:08:24 -07:00
parent 9292ebbe48
commit 1dad0126bc
6 changed files with 14 additions and 5 deletions

View File

@@ -50,10 +50,16 @@ export class PythonRuntimeWorker extends ChildProcessWorker {
}
let pythonPath = process.env.SCRYPTED_PYTHON_PATH;
const pluginPythonVersion = options.packageJson.scrypted.pythonVersion?.[os.platform()]?.[os.arch()] || options.packageJson.scrypted.pythonVersion?.default;
if (os.platform() === 'win32') {
pythonPath ||= 'py.exe';
if (process.env.SCRYPTED_WINDOWS_PYTHON_VERSION)
args.unshift(process.env.SCRYPTED_WINDOWS_PYTHON_VERSION)
const windowsPythonVersion = pluginPythonVersion || process.env.SCRYPTED_WINDOWS_PYTHON_VERSION;
if (windowsPythonVersion)
args.unshift(windowsPythonVersion)
}
else if (pluginPythonVersion) {
pythonPath = `python${pluginPythonVersion}`;
}
else {
pythonPath ||= 'python3';

View File

@@ -4,6 +4,7 @@ import { Readable } from "stream";
import net from "net";
export interface RuntimeWorkerOptions {
packageJson: any;
pluginDebug: PluginDebug;
env: any;
}