Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines +156 to +158
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense, thanks 👍🏻

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif [[ -d "${HOME}/Library/Application Support/homebrew" ]]
then
HOMEBREW_USER_CONFIG_HOME="${HOME}/Library/Application Support/homebrew"
elif [[ -d "${HOME}/Library/Application Support/Homebrew" ]]
then
HOMEBREW_USER_CONFIG_HOME="${HOME}/Library/Application Support/Homebrew"

I think directories in ~/Library are usually capitalised.

Copy link
Author

@etcusrvar etcusrvar Jul 14, 2025

Choose a reason for hiding this comment

The 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
Expand Down
Loading