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