diff --git a/packages/api/src/controllers/runners.js b/packages/api/src/controllers/runners.js index 98eab3b6..6ae95027 100644 --- a/packages/api/src/controllers/runners.js +++ b/packages/api/src/controllers/runners.js @@ -96,10 +96,10 @@ module.exports = { console.log(`RUNNING SCRIPT ${scriptFile}`); // const subprocess = fork(scriptFile, ['--checkParent', '--max-old-space-size=8192'], { const subprocess = fork(scriptFile, ['--checkParent', ...process.argv.slice(3)], { + cwd: directory, stdio: ['ignore', 'pipe', 'pipe', 'ipc'], env: { DBGATE_API: global['dbgateApiModulePath'] || process.argv[1], - DBGATE_CWD: directory, ..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, path.join(pluginsdir(), name)])), }, }); diff --git a/packages/api/src/shell/initializeApiEnvironment.js b/packages/api/src/shell/initializeApiEnvironment.js index 5b6d14cf..96566272 100644 --- a/packages/api/src/shell/initializeApiEnvironment.js +++ b/packages/api/src/shell/initializeApiEnvironment.js @@ -4,10 +4,6 @@ async function initializeApiEnvironment() { process.on('message', async message => { handleProcessCommunication(message); }); - - if (process.env.DBGATE_CWD) { - process.chdir(process.env.DBGATE_CWD); - } } module.exports = initializeApiEnvironment; diff --git a/packages/api/src/utility/platformInfo.js b/packages/api/src/utility/platformInfo.js index 22ba0fb2..2557907d 100644 --- a/packages/api/src/utility/platformInfo.js +++ b/packages/api/src/utility/platformInfo.js @@ -14,7 +14,7 @@ const platformInfo = { isMac, isLinux, isDocker, - isSnap: p.env.ELECTRON_SNAP, + isSnap: p.env.ELECTRON_SNAP == 'true', isPortable: isWindows && p.env.PORTABLE_EXECUTABLE_DIR, isAppImage: p.env.DESKTOPINTEGRATION === 'AppImageLauncher', sshAuthSock: p.env.SSH_AUTH_SOCK,