-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Check for npmrc in home directory for linux root users (#4047)
**Summary** Fix for #3920. In this [commit](https://github.com/wtgtybhertgeghgtwtg/yarn/commit/f4fe7431ed992862a1c1d2357e6521c268bad7a7), `userHome` for linux users running as root was changed to `/usr/local/share`, mainly to allow for other users to run globally added bins. However this introduced a bug where npmrc wasn't being looked in the root directory after checking `/user/local/share`. So this change pushes another location to check in case `userHome` is different from native home directory returned by `os.homedir()` **Test plan** I've added a test to generally test the `getPossibleConfigLocations` method, but I haven't been able to properly mock out running it as a root user on linux. Suggestions welcome!
- Loading branch information
Showing
3 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters