-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix: More resillient global and cache folder determination #4325
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
fa98ad9
Fix: Make sure global prefix folder is writeable when selecting it
BYK f4b48aa
Fix wrong error message template used from getGlobalPrefix
BYK b1c43cc
Better error message
BYK a9b3542
Add process.execPath as a last resort
BYK e478af9
Add back $DESTDIR support removed from #3721
BYK dcb953c
Fix DESTDIR typo
BYK 5685843
Fix skippedFolder error
BYK 9576dbd
don't use rimraf to remove a file
BYK b9c0fb8
Don't use process.execPath
BYK 73c61ae
Defer write checks for global prefix
BYK 1e6b708
flow type
BYK 54c7581
Just warn when a proper global folder cannot be found, instead of fai…
BYK 86de168
Add TODO about inconsistent npm-registry code
BYK 89d52ce
Keep the old behavior
BYK f21abfb
Update fs.js
arcanis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the problem with this code:
We only need write permissions when doing
yarn global add
which is usually called withsudo
or similar. That said if we change our permission checks depending on usage, then we may end up using two different global folders based on howyarn
is called (with sudo and without) which would make runningyarn global add
useless.I think we should just check
R_OK
andX_OK
here but doing that caused some failing tests (which can be fixed, I'm sure). This would also be a breaking change. That said I'm almost certain thatPOSIX_GLOBAL_PREFIX/bin
won't be writeable to yarn by default. What do you think?