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
Post a Comment