fixed exports in dbgate NPM package

This commit is contained in:
Jan Prochazka 2021-02-14 11:33:53 +01:00
parent 58f213d042
commit 9f3aadc17d
2 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,7 @@ module.exports = {
const subprocess = fork(scriptFile, ['--checkParent', ...process.argv.slice(3)], { const subprocess = fork(scriptFile, ['--checkParent', ...process.argv.slice(3)], {
stdio: ['ignore', 'pipe', 'pipe', 'ipc'], stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
env: { env: {
DBGATE_API: process.argv[1], DBGATE_API: global['dbgateApiModulePath'] || process.argv[1],
DBGATE_CWD: directory, 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)])),
}, },

View File

@ -2,4 +2,6 @@
const dbgateApi = require('dbgate-api'); const dbgateApi = require('dbgate-api');
global.dbgateApiModulePath = require.resolve('dbgate-api');
dbgateApi.getMainModule().start('startNodeWeb'); dbgateApi.getMainModule().start('startNodeWeb');