mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 20:06:00 +00:00
try to fix pl;ugin directories
This commit is contained in:
@@ -30,6 +30,7 @@ class DatastoreProxy {
|
||||
async ensureSubprocess() {
|
||||
if (!this.subprocess) {
|
||||
this.subprocess = fork(global['API_PACKAGE'] || process.argv[1], [
|
||||
'--is-forked-api',
|
||||
'--start-process',
|
||||
'jslDatastoreProcess',
|
||||
...process.argv.slice(3),
|
||||
|
||||
@@ -41,6 +41,10 @@ const archivedir = dirFunc('archive');
|
||||
const filesdir = dirFunc('files');
|
||||
|
||||
function packagedPluginsDir() {
|
||||
// console.log('CALL DIR FROM', new Error('xxx').stack);
|
||||
// console.log('__dirname', __dirname);
|
||||
// console.log('platformInfo.isElectronBundle', platformInfo.isElectronBundle);
|
||||
// console.log('platformInfo.isForkedApi', platformInfo.isForkedApi);
|
||||
if (platformInfo.isDevMode) {
|
||||
return path.resolve(__dirname, '../../../../plugins');
|
||||
}
|
||||
@@ -53,6 +57,12 @@ function packagedPluginsDir() {
|
||||
}
|
||||
if (platformInfo.isElectronBundle) {
|
||||
return path.resolve(__dirname, '../../plugins');
|
||||
|
||||
// if (platformInfo.isForkedApi) {
|
||||
// return path.resolve(__dirname, '../plugins');
|
||||
// } else {
|
||||
// return path.resolve(__dirname, '../../plugins');
|
||||
// }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ const isLinux = platform === 'linux';
|
||||
const isDocker = fs.existsSync('/home/dbgate-docker/public');
|
||||
const isDevMode = process.env.DEVMODE == '1';
|
||||
const isNpmDist = !!global['dbgateApiModulePath'];
|
||||
const isForkedApi = processArgs.isForkedApi;
|
||||
|
||||
// function moduleAvailable(name) {
|
||||
// try {
|
||||
@@ -21,14 +22,13 @@ const isNpmDist = !!global['dbgateApiModulePath'];
|
||||
// }
|
||||
// }
|
||||
|
||||
const isElectronBundle = processArgs.isElectronBundle;
|
||||
|
||||
const platformInfo = {
|
||||
isWindows,
|
||||
isMac,
|
||||
isLinux,
|
||||
isDocker,
|
||||
isElectronBundle,
|
||||
isElectronBundle: isElectron() && !isDevMode,
|
||||
isForkedApi,
|
||||
isElectron: isElectron(),
|
||||
isDevMode,
|
||||
isNpmDist,
|
||||
|
||||
@@ -7,15 +7,13 @@ function getNamedArg(name) {
|
||||
}
|
||||
|
||||
const checkParent = process.argv.includes('--checkParent');
|
||||
const dynport = process.argv.includes('--dynport');
|
||||
const nativeModules = getNamedArg('--native-modules');
|
||||
const startProcess = getNamedArg('--start-process');
|
||||
const isElectronBundle = process.argv.includes('--is-electron-bundle');
|
||||
const isForkedApi = process.argv.includes('--is-forked-api');
|
||||
|
||||
module.exports = {
|
||||
checkParent,
|
||||
nativeModules,
|
||||
startProcess,
|
||||
dynport,
|
||||
isElectronBundle,
|
||||
isForkedApi,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user