runners cwd simplified

This commit is contained in:
Jan Prochazka 2021-02-14 19:09:52 +01:00
parent 7b67576131
commit 98ff6db701
3 changed files with 2 additions and 6 deletions

View File

@ -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)])),
},
});

View File

@ -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;

View File

@ -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,