server: prevent windows from clobbering python path

This commit is contained in:
Koushik Dutta
2024-01-24 23:46:58 -08:00
parent 135ad8e3a8
commit f5a32489d7

View File

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