Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underscore prefixed config (_auth) provided by env var is converted to dash (-auth) #4682

Closed
krmcbride opened this issue Oct 11, 2017 · 1 comment

Comments

@krmcbride
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
npm config that have a _ prefix (_auth, _authToken, _password), when provided as environment variables (export npm_config__auth=blah) have their _ prefix converted to - (-auth instead of _auth for example).

If the current behavior is a bug, please provide the steps to reproduce.

npm_config__auth=abc yarn config get _auth
undefined

npm_config__auth=abc yarn config list | grep abc
  '-auth': 'abc' }

What is the expected behavior?
The npm config which start with _ have their prefix untouched (npm_config__auth -> _auth)

Please mention your node.js, yarn and operating system version.
yarn 1.1.0 and 1.2.0
node 6.11.4
debian jessie

@NicholasBoll
Copy link
Contributor

I found the line that is doing this:

key = key.replace(/_/g, '-');

NicholasBoll added a commit to NicholasBoll/yarn that referenced this issue Feb 27, 2019
arcanis pushed a commit that referenced this issue Mar 5, 2019
* fix: handle npm prefix config environment variables
Fixes #4682

* Updated changelog

* Implemented PR feedback

* Fixed logic error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants