Skip to content

Commit

Permalink
Fix parsing of environment variables when merging env into config (#6518
Browse files Browse the repository at this point in the history
)

* Environment variable prefixes should start at the beginning, not in the middle of an environment variable. This fixes this example:

  SOME_YARN_CONFIG=123 yarn config list | grep some
    'some-yarn-config':
  { 'some-yarn-config':

* Update CHANGELOG.md
  • Loading branch information
grembo authored and arcanis committed Oct 10, 2018
1 parent 86888e1 commit f2206d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa

## Master

- Environment variables now have to **start** with `YARN_` (instead of just contain it) to be considered

[#6518](https://github.com/yarnpkg/yarn/pull/6518) - [**Michael Gmelin**](https://blog.grem.de)

- Fixes the `extensions` option when used by `resolveRequest`

[#6479](https://github.com/yarnpkg/yarn/pull/6479) - [**Maël Nison**](https://twitter.com/arcanis)
Expand Down
2 changes: 1 addition & 1 deletion src/registries/base-registry.js
Expand Up @@ -151,7 +151,7 @@ export default class BaseRegistry {
let key = envKey.toLowerCase();

// only accept keys prefixed with the prefix
if (key.indexOf(prefix.toLowerCase()) < 0) {
if (key.indexOf(prefix.toLowerCase()) !== 0) {
continue;
}

Expand Down

0 comments on commit f2206d2

Please sign in to comment.