简体   繁体   中英

How to set value for environment.js file variable in ember js using command prompt?

I am trying to execute following command for setting the value in environment.js file value in ember js. But value not set.

setx DEPLOY_USER "User name here"
ember build --environment production

in environment.js :

if (process.env.DEPLOY_USER) {
    ENV.builderName= process.env.DEPLOY_USER;
  }

i will display this "ENV.builderName" in page. i can't hard code this value in environment.js, since this value will change according to who is building the solution.

but the value "process.env.DEPLOY_USER" is always undefined. i'm building solution in Command prompt in Windows OS

In windows, below is working fine.

set DEPLOY_USER="User name here"
ember build --environment=production

and ensure the code is executing, I mean, it should not be in development if block.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM