node.js - Pass shell environment variable as argument in npm script -


i'm trying pass environment variables npm scripts arguments no success.

export environment=test.proxy.json npm run test 

i'm trying in package.json

npm run test --proxy-config-file $environment 

when this:

export environment=test.proxy.json npm run test 

or this:

environment=test.proxy.json npm run test 

then pass "test.proxy.json" string value of environment variable named environment.

if want pass arguments npm scripts may need use:

npm run test -- --proxy-config-file $environment 

keep in mind if pass argument npm script, doesn't mean passed other scripts script executing. environment variables it's other way around - default should passed 1 script other there still no guarantee caller may decide environment variables pass, if any.

but it's hard tell question real problem here - phrase "with no success" general know problem here.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -