Introduce isStagingServer util method
This commit is contained in:
parent
4cdb6fab08
commit
cd44a7a033
24 changed files with 80 additions and 71 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
// In production mode, NODE_ENV cannot be customized by the user
|
||||
if (app.isPackaged) {
|
||||
setEnvironment(Environment.Production, false);
|
||||
setEnvironment(Environment.PackagedApp, false);
|
||||
} else {
|
||||
setEnvironment(
|
||||
parseEnvironment(process.env.NODE_ENV || 'development'),
|
||||
|
@ -27,7 +27,7 @@ if (app.isPackaged) {
|
|||
process.env.NODE_ENV = getEnvironment();
|
||||
process.env.NODE_CONFIG_DIR = join(__dirname, '..', 'config');
|
||||
|
||||
if (getEnvironment() === Environment.Production) {
|
||||
if (getEnvironment() === Environment.PackagedApp) {
|
||||
// harden production config against the local env
|
||||
process.env.NODE_CONFIG = '';
|
||||
process.env.NODE_CONFIG_STRICT_MODE = '';
|
||||
|
@ -47,7 +47,7 @@ if (getEnvironment() === Environment.Production) {
|
|||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const config: IConfig = require('config');
|
||||
|
||||
if (getEnvironment() !== Environment.Production) {
|
||||
if (getEnvironment() !== Environment.PackagedApp) {
|
||||
config.util.getConfigSources().forEach(source => {
|
||||
console.log(`config: Using config source ${basename(source.name)}`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue