-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
bin/brew: better user config home handling #20250
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -153,9 +153,18 @@ fi | |||||||||||||
export_homebrew_env_file "${HOMEBREW_PREFIX}/etc/homebrew/brew.env" | ||||||||||||||
|
||||||||||||||
# Finally, load the user configuration | ||||||||||||||
if [[ -n "${XDG_CONFIG_HOME-}" ]] | ||||||||||||||
if [[ -d "${HOME}/.homebrew" ]] | ||||||||||||||
then | ||||||||||||||
HOMEBREW_USER_CONFIG_HOME="${HOME}/.homebrew" | ||||||||||||||
elif [[ -n "${XDG_CONFIG_HOME-}" ]] | ||||||||||||||
then | ||||||||||||||
HOMEBREW_USER_CONFIG_HOME="${XDG_CONFIG_HOME}/homebrew" | ||||||||||||||
elif [[ -d "${HOME}/.config/homebrew" ]] | ||||||||||||||
then | ||||||||||||||
HOMEBREW_USER_CONFIG_HOME="${HOME}/.config/homebrew" | ||||||||||||||
elif [[ -d "${HOME}/Library/Application Support/homebrew" ]] | ||||||||||||||
then | ||||||||||||||
HOMEBREW_USER_CONFIG_HOME="${HOME}/Library/Application Support/homebrew" | ||||||||||||||
Comment on lines
+165
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think directories in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "usually" being the operative word. I do see a handful of directories on my system that aren't. I was aiming for consistency across homebrew options. But I'm fine with having it be capitalized there and lower case in other locations if we want. |
||||||||||||||
else | ||||||||||||||
HOMEBREW_USER_CONFIG_HOME="${HOME}/.homebrew" | ||||||||||||||
fi | ||||||||||||||
|
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.
This is already handled by the
else
case.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.
yes. The reason I did this this way was because I didn't want a user who might have both
~/.homebrew
and one of the other 3 directories created to be surprised when their configuration suddenly changed. But I'm fine with only defining it once.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.
Ok, makes sense, thanks 👍🏻