File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ class CfEnv {
2424 }
2525
2626 constructor ( env = process . env ) {
27- if ( env . NODE_ENV !== "production" ) {
27+ if ( env . NODE_ENV !== "production" && env . USE_DEFAULT_ENV ) {
2828 try {
2929 const { VCAP_APPLICATION , VCAP_SERVICES } = require ( process . cwd ( ) + "/default-env.json" ) ;
30- env . VCAP_APPLICATION = JSON . stringify ( VCAP_APPLICATION ) ;
31- env . VCAP_SERVICES = JSON . stringify ( VCAP_SERVICES ) ;
30+ if ( VCAP_APPLICATION && ! Object . prototype . hasOwnProperty . call ( env , "VCAP_APPLICATION" ) ) {
31+ env . VCAP_APPLICATION = JSON . stringify ( VCAP_APPLICATION ) ;
32+ }
33+ if ( VCAP_SERVICES && ! Object . prototype . hasOwnProperty . call ( env , "VCAP_SERVICES" ) ) {
34+ env . VCAP_SERVICES = JSON . stringify ( VCAP_SERVICES ) ;
35+ }
3236 } catch ( err ) { } // eslint-disable-line no-empty
3337 }
3438
You can’t perform that action at this time.
0 commit comments