This commit is contained in:
Jan Prochazka
2021-04-17 11:01:42 +02:00
parent 76e51343d0
commit a6207f01af
4 changed files with 17 additions and 15 deletions

View File

@@ -51,7 +51,7 @@ function packagedPluginsDir() {
// node_modules
return global['dbgateApiPackagedPluginsPath'];
}
if (platformInfo.isElectron) {
if (platformInfo.isElectronBundle) {
return path.resolve(__dirname, '../../plugins');
}
return null;

View File

@@ -11,23 +11,23 @@ const isDocker = fs.existsSync('/home/dbgate-docker/build');
const isDevMode = p.env.DEVMODE == '1';
const isNpmDist = p.argv[2] == 'startNodeWeb';
function moduleAvailable(name) {
try {
require.resolve(name);
return true;
} catch (e) {
return false;
}
}
// function moduleAvailable(name) {
// try {
// require.resolve(name);
// return true;
// } catch (e) {
// return false;
// }
// }
const isElectron = moduleAvailable('electron');
const isElectronBundle = p.argv.indexOf('--is-electron-bundle') >= 0;
const platformInfo = {
isWindows,
isMac,
isLinux,
isDocker,
isElectron,
isElectronBundle,
isDevMode,
isNpmDist,
isSnap: p.env.ELECTRON_SNAP == 'true',