Remove redundance LOKI_DEV variable in scripts

pull/1017/head
Mikunj 5 years ago
parent b97a68c7f6
commit 3f5a8e7b1b

@ -1,12 +1,14 @@
const path = require('path'); const path = require('path');
const electronIsDev = require('electron-is-dev'); const isDevelopment = require('electron-is-dev');
let environment; let environment;
// In production mode, NODE_ENV cannot be customized by the user // In production mode, NODE_ENV cannot be customized by the user
if (electronIsDev) { if (isDevelopment) {
console.log('development');
environment = process.env.NODE_ENV || 'development'; environment = process.env.NODE_ENV || 'development';
process.env.LOKI_DEV = 1;
} else { } else {
environment = 'production'; environment = 'production';
} }
@ -23,7 +25,9 @@ if (environment === 'production') {
process.env.ALLOW_CONFIG_MUTATIONS = ''; process.env.ALLOW_CONFIG_MUTATIONS = '';
process.env.SUPPRESS_NO_CONFIG_WARNING = ''; process.env.SUPPRESS_NO_CONFIG_WARNING = '';
process.env.NODE_TLS_REJECT_UNAUTHORIZED = ''; process.env.NODE_TLS_REJECT_UNAUTHORIZED = '';
if (!process.env.LOKI_DEV) {
// We could be running againt production but still be in dev mode, we need to handle that
if (!isDevelopment) {
process.env.NODE_APP_INSTANCE = ''; process.env.NODE_APP_INSTANCE = '';
} }
} }
@ -39,9 +43,6 @@ config.environment = environment;
'NODE_APP_INSTANCE', 'NODE_APP_INSTANCE',
'NODE_CONFIG_DIR', 'NODE_CONFIG_DIR',
'NODE_CONFIG', 'NODE_CONFIG',
'ALLOW_CONFIG_MUTATIONS',
'HOSTNAME',
'SUPPRESS_NO_CONFIG_WARNING',
].forEach(s => { ].forEach(s => {
console.log(`${s} ${config.util.getEnv(s)}`); console.log(`${s} ${config.util.getEnv(s)}`);
}); });

@ -57,7 +57,6 @@ module.exports = {
env: { env: {
NODE_APP_INSTANCE: env, NODE_APP_INSTANCE: env,
NODE_ENV: 'production', NODE_ENV: 'production',
LOKI_DEV: 1,
USE_STUBBED_NETWORK: true, USE_STUBBED_NETWORK: true,
ELECTRON_ENABLE_LOGGING: true, ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true, ELECTRON_ENABLE_STACK_DUMPING: true,

@ -18,10 +18,10 @@
"start": "electron .", "start": "electron .",
"start-multi": "cross-env NODE_APP_INSTANCE=1 electron .", "start-multi": "cross-env NODE_APP_INSTANCE=1 electron .",
"start-multi2": "cross-env NODE_APP_INSTANCE=2 electron .", "start-multi2": "cross-env NODE_APP_INSTANCE=2 electron .",
"start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod LOKI_DEV=1 electron .", "start-prod": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod electron .",
"start-prod-multi": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod1 LOKI_DEV=1 electron .", "start-prod-multi": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod1 electron .",
"start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=1 LOKI_DEV=1 electron .", "start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=1 electron .",
"start-swarm-test-2": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=2 LOKI_DEV=1 electron .", "start-swarm-test-2": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=2 electron .",
"grunt": "grunt", "grunt": "grunt",
"icon-gen": "electron-icon-maker --input=images/icon_1024.png --output=./build", "icon-gen": "electron-icon-maker --input=images/icon_1024.png --output=./build",
"generate": "yarn icon-gen && yarn grunt", "generate": "yarn icon-gen && yarn grunt",

Loading…
Cancel
Save