mirror of
https://github.com/dbgate/dbgate
synced 2024-11-21 23:39:46 +00:00
try to fix npm build
This commit is contained in:
parent
ba77b32e9a
commit
45277e34c9
@ -3,6 +3,7 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
const cleanDirectory = require('./cleanDirectory');
|
||||
const platformInfo = require('./platformInfo');
|
||||
const processArgs = require('./processArgs');
|
||||
|
||||
const createDirectories = {};
|
||||
const ensureDirectory = (dir, clean) => {
|
||||
@ -56,6 +57,9 @@ function packagedPluginsDir() {
|
||||
// node_modules
|
||||
return global['PLUGINS_DIR'];
|
||||
}
|
||||
if (processArgs.pluginsDir) {
|
||||
return processArgs.pluginsDir;
|
||||
}
|
||||
if (platformInfo.isElectronBundle) {
|
||||
return path.resolve(__dirname, '../../plugins');
|
||||
|
||||
|
@ -9,10 +9,17 @@ function getNamedArg(name) {
|
||||
const checkParent = process.argv.includes('--checkParent');
|
||||
const startProcess = getNamedArg('--start-process');
|
||||
const isForkedApi = process.argv.includes('--is-forked-api');
|
||||
const pluginsDir = getNamedArg('--plugins-dir');
|
||||
|
||||
function getPassArgs() {
|
||||
if (global['NATIVE_MODULES']) return ['--native-modules', global['NATIVE_MODULES']];
|
||||
return [];
|
||||
const res = [];
|
||||
if (global['NATIVE_MODULES']) {
|
||||
res.push('--native-modules', global['NATIVE_MODULES']);
|
||||
}
|
||||
if (global['PLUGINS_DIR']) {
|
||||
res.push('--plugins-dir', global['PLUGINS_DIR']);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
@ -20,4 +27,5 @@ module.exports = {
|
||||
startProcess,
|
||||
isForkedApi,
|
||||
getPassArgs,
|
||||
pluginsDir,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user