Fix bridge: PYTHONPATH con pylibs per websockets (bridge.py falliva con ModuleNotFoundError)
This commit is contained in:
@@ -36,6 +36,8 @@ const SCRIPT =
|
||||
process.env.FIREFOX_BIDI_SCRIPT ?? "/home/enne2/Dev/firefox-bidi/start-firefox-bidi.sh";
|
||||
const BRIDGE_PY =
|
||||
process.env.FIREFOX_BIDI_BRIDGE_PY ?? "/home/enne2/Dev/firefox-bidi/bridge/bridge.py";
|
||||
const BRIDGE_PYLIBS =
|
||||
process.env.FIREFOX_BIDI_PYLIBS ?? "/home/enne2/Dev/firefox-bidi/pylibs";
|
||||
|
||||
const DEFAULT_TIMEOUT_MS = 120_000; // comandi BiDi lunghi (navigate wait:"complete")
|
||||
const STATUS_TIMEOUT_MS = 5_000;
|
||||
@@ -166,7 +168,14 @@ async function startFirefox(profile: "dedicated" | "main"): Promise<void> {
|
||||
}
|
||||
|
||||
function startBridgeProcess(): void {
|
||||
bridgeProcess = spawn("python3", [BRIDGE_PY], { stdio: "ignore", detached: true });
|
||||
bridgeProcess = spawn("python3", [BRIDGE_PY], {
|
||||
stdio: "ignore",
|
||||
detached: true,
|
||||
env: {
|
||||
...process.env,
|
||||
PYTHONPATH: [BRIDGE_PYLIBS, process.env.PYTHONPATH ?? ""].filter(Boolean).join(":"),
|
||||
},
|
||||
});
|
||||
bridgeProcess.unref();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user