mirror of
https://github.com/koush/scrypted.git
synced 2026-04-27 02:11:08 +01:00
server: add explicit hook for main file
This commit is contained in:
@@ -58,12 +58,14 @@ export class PythonRuntimeWorker extends ChildProcessWorker {
|
||||
|
||||
args.push(this.pluginId);
|
||||
|
||||
const types = require.resolve('@scrypted/types');
|
||||
const PYTHONPATH = types.substring(0, types.indexOf('@scrypted/types') + '@scrypted/types'.length);
|
||||
this.worker = child_process.spawn(pythonPath, args, {
|
||||
// stdin, stdout, stderr, peer in, peer out
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe'],
|
||||
env: Object.assign({
|
||||
PYTHONUNBUFFERED: '1',
|
||||
PYTHONPATH: path.join(process.cwd(), 'node_modules/@scrypted/types'),
|
||||
PYTHONPATH,
|
||||
}, gstEnv, process.env, env),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user