mirror of
https://github.com/koush/scrypted.git
synced 2026-04-27 02:11:08 +01:00
server/windows: add support for python version when used with py.exe
This commit is contained in:
@@ -46,7 +46,15 @@ export class PythonRuntimeWorker extends ChildProcessWorker {
|
||||
}
|
||||
}
|
||||
|
||||
const pythonPath = process.env.SCRYPTED_PYTHON_PATH || (os.platform() === 'win32' ? 'py.exe' : 'python3');
|
||||
let pythonPath = process.env.SCRYPTED_PYTHON_PATH;
|
||||
if (os.platform() === 'win32') {
|
||||
pythonPath ||= 'py.exe';
|
||||
if (process.env.SCRYPTED_WINDOWS_PYTHON_VERSION)
|
||||
args.unshift(process.env.SCRYPTED_WINDOWS_PYTHON_VERSION)
|
||||
}
|
||||
else {
|
||||
pythonPath ||= 'python3';
|
||||
}
|
||||
|
||||
this.worker = child_process.spawn(pythonPath, args, {
|
||||
// stdin, stdout, stderr, peer in, peer out
|
||||
|
||||
Reference in New Issue
Block a user