mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 02:43:59 +00:00
runners cwd simplified
This commit is contained in:
@@ -96,10 +96,10 @@ module.exports = {
|
|||||||
console.log(`RUNNING SCRIPT ${scriptFile}`);
|
console.log(`RUNNING SCRIPT ${scriptFile}`);
|
||||||
// const subprocess = fork(scriptFile, ['--checkParent', '--max-old-space-size=8192'], {
|
// const subprocess = fork(scriptFile, ['--checkParent', '--max-old-space-size=8192'], {
|
||||||
const subprocess = fork(scriptFile, ['--checkParent', ...process.argv.slice(3)], {
|
const subprocess = fork(scriptFile, ['--checkParent', ...process.argv.slice(3)], {
|
||||||
|
cwd: directory,
|
||||||
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
||||||
env: {
|
env: {
|
||||||
DBGATE_API: global['dbgateApiModulePath'] || process.argv[1],
|
DBGATE_API: global['dbgateApiModulePath'] || process.argv[1],
|
||||||
DBGATE_CWD: directory,
|
|
||||||
..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, path.join(pluginsdir(), name)])),
|
..._.fromPairs(pluginNames.map(name => [`PLUGIN_${_.camelCase(name)}`, path.join(pluginsdir(), name)])),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ async function initializeApiEnvironment() {
|
|||||||
process.on('message', async message => {
|
process.on('message', async message => {
|
||||||
handleProcessCommunication(message);
|
handleProcessCommunication(message);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.DBGATE_CWD) {
|
|
||||||
process.chdir(process.env.DBGATE_CWD);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = initializeApiEnvironment;
|
module.exports = initializeApiEnvironment;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const platformInfo = {
|
|||||||
isMac,
|
isMac,
|
||||||
isLinux,
|
isLinux,
|
||||||
isDocker,
|
isDocker,
|
||||||
isSnap: p.env.ELECTRON_SNAP,
|
isSnap: p.env.ELECTRON_SNAP == 'true',
|
||||||
isPortable: isWindows && p.env.PORTABLE_EXECUTABLE_DIR,
|
isPortable: isWindows && p.env.PORTABLE_EXECUTABLE_DIR,
|
||||||
isAppImage: p.env.DESKTOPINTEGRATION === 'AppImageLauncher',
|
isAppImage: p.env.DESKTOPINTEGRATION === 'AppImageLauncher',
|
||||||
sshAuthSock: p.env.SSH_AUTH_SOCK,
|
sshAuthSock: p.env.SSH_AUTH_SOCK,
|
||||||
|
|||||||
Reference in New Issue
Block a user