From 3f5a8e7b1bd62d9c1d4d5166d4760d557bfa6866 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Thu, 26 Mar 2020 16:15:34 +1100 Subject: [PATCH] Remove redundance LOKI_DEV variable in scripts --- app/config.js | 13 +++++++------ integration_test/common.js | 1 - package.json | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/config.js b/app/config.js index bd71b799c..d3a97becb 100644 --- a/app/config.js +++ b/app/config.js @@ -1,12 +1,14 @@ const path = require('path'); -const electronIsDev = require('electron-is-dev'); +const isDevelopment = require('electron-is-dev'); let environment; // In production mode, NODE_ENV cannot be customized by the user -if (electronIsDev) { +if (isDevelopment) { + console.log('development'); environment = process.env.NODE_ENV || 'development'; + process.env.LOKI_DEV = 1; } else { environment = 'production'; } @@ -23,7 +25,9 @@ if (environment === 'production') { process.env.ALLOW_CONFIG_MUTATIONS = ''; process.env.SUPPRESS_NO_CONFIG_WARNING = ''; 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 = ''; } } @@ -39,9 +43,6 @@ config.environment = environment; 'NODE_APP_INSTANCE', 'NODE_CONFIG_DIR', 'NODE_CONFIG', - 'ALLOW_CONFIG_MUTATIONS', - 'HOSTNAME', - 'SUPPRESS_NO_CONFIG_WARNING', ].forEach(s => { console.log(`${s} ${config.util.getEnv(s)}`); }); diff --git a/integration_test/common.js b/integration_test/common.js index 4d9d36055..35e2067ec 100644 --- a/integration_test/common.js +++ b/integration_test/common.js @@ -57,7 +57,6 @@ module.exports = { env: { NODE_APP_INSTANCE: env, NODE_ENV: 'production', - LOKI_DEV: 1, USE_STUBBED_NETWORK: true, ELECTRON_ENABLE_LOGGING: true, ELECTRON_ENABLE_STACK_DUMPING: true, diff --git a/package.json b/package.json index 9ba68d708..6cc5f7249 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "start": "electron .", "start-multi": "cross-env NODE_APP_INSTANCE=1 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-multi": "cross-env NODE_ENV=production NODE_APP_INSTANCE=devprod1 LOKI_DEV=1 electron .", - "start-swarm-test": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=1 LOKI_DEV=1 electron .", - "start-swarm-test-2": "cross-env NODE_ENV=swarm-testing NODE_APP_INSTANCE=2 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 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 electron .", "grunt": "grunt", "icon-gen": "electron-icon-maker --input=images/icon_1024.png --output=./build", "generate": "yarn icon-gen && yarn grunt",