Skip to content

Commit

Permalink
Merge pull request #19155 from Homebrew/revert-19153-env_var_consistency
Browse files Browse the repository at this point in the history
Use `~` instead of `${HOME}`
  • Loading branch information
MikeMcQuaid authored Jan 27, 2025
2 parents e21cbd6 + 7ff99e2 commit 23facb2
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 210 deletions.
26 changes: 13 additions & 13 deletions Library/Homebrew/cask/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ class Config
{
appdir: "/Applications",
keyboard_layoutdir: "/Library/Keyboard Layouts",
colorpickerdir: "${HOME}/Library/ColorPickers",
prefpanedir: "${HOME}/Library/PreferencePanes",
qlplugindir: "${HOME}/Library/QuickLook",
mdimporterdir: "${HOME}/Library/Spotlight",
dictionarydir: "${HOME}/Library/Dictionaries",
fontdir: "${HOME}/Library/Fonts",
servicedir: "${HOME}/Library/Services",
input_methoddir: "${HOME}/Library/Input Methods",
internet_plugindir: "${HOME}/Library/Internet Plug-Ins",
audio_unit_plugindir: "${HOME}/Library/Audio/Plug-Ins/Components",
vst_plugindir: "${HOME}/Library/Audio/Plug-Ins/VST",
vst3_plugindir: "${HOME}/Library/Audio/Plug-Ins/VST3",
screen_saverdir: "${HOME}/Library/Screen Savers",
colorpickerdir: "~/Library/ColorPickers",
prefpanedir: "~/Library/PreferencePanes",
qlplugindir: "~/Library/QuickLook",
mdimporterdir: "~/Library/Spotlight",
dictionarydir: "~/Library/Dictionaries",
fontdir: "~/Library/Fonts",
servicedir: "~/Library/Services",
input_methoddir: "~/Library/Input Methods",
internet_plugindir: "~/Library/Internet Plug-Ins",
audio_unit_plugindir: "~/Library/Audio/Plug-Ins/Components",
vst_plugindir: "~/Library/Audio/Plug-Ins/VST",
vst3_plugindir: "~/Library/Audio/Plug-Ins/VST3",
screen_saverdir: "~/Library/Screen Savers",
}.freeze,
T::Hash[Symbol, String],
)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/nodenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Cmd
class NodenvSync < AbstractCommand
cmd_args do
description <<~EOS
Create symlinks for Homebrew's installed NodeJS versions in `${HOME}/.nodenv/versions`.
Create symlinks for Homebrew's installed NodeJS versions in `~/.nodenv/versions`.
Note that older version symlinks will also be created so e.g. NodeJS 19.1.0 will
also be symlinked to 19.0.0.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/pyenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Cmd
class PyenvSync < AbstractCommand
cmd_args do
description <<~EOS
Create symlinks for Homebrew's installed Python versions in `${HOME}/.pyenv/versions`.
Create symlinks for Homebrew's installed Python versions in `~/.pyenv/versions`.
Note that older patch version symlinks will be created and linked to the minor
version so e.g. Python 3.11.0 will also be symlinked to 3.11.3.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/rbenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Cmd
class RbenvSync < AbstractCommand
cmd_args do
description <<~EOS
Create symlinks for Homebrew's installed Ruby versions in `${HOME}/.rbenv/versions`.
Create symlinks for Homebrew's installed Ruby versions in `~/.rbenv/versions`.
Note that older version symlinks will also be created so e.g. Ruby 3.2.1 will
also be symlinked to 3.2.0.
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/shellenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Shellenv < AbstractCommand
querying them multiple times.
To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` directories
are first and second respectively in your `PATH`. Consider adding evaluation of this command's output to
your dotfiles (e.g. `${HOME}/.bash_profile` or `${HOME}/.zprofile` on macOS and `${HOME}/.bashrc` or
`${HOME}/.zshrc` on Linux) with: `eval "$(brew shellenv)"`
your dotfiles (e.g. `~/.bash_profile` or ~/.zprofile` on macOS and ~/.bashrc` or ~/.zshrc` on Linux) with:
`eval "$(brew shellenv)"`
The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output
POSIX exports.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LivecheckCmd < AbstractCommand
Check for newer versions of formulae and/or casks from upstream.
If no formula or cask argument is passed, the list of formulae and
casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or
`${HOME}/.homebrew/livecheck_watchlist.txt`.
`~/.homebrew/livecheck_watchlist.txt`.
EOS
switch "--full-name",
description: "Print formulae and casks with fully-qualified names."
Expand Down
16 changes: 8 additions & 8 deletions Library/Homebrew/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ module EnvConfig
},
HOMEBREW_CACHE: {
description: "Use this directory as the download cache.",
default_text: "macOS: `$HOME/Library/Caches/Homebrew`, " \
"Linux: `$XDG_CACHE_HOME/Homebrew` or `$HOME/.cache/Homebrew`.",
default_text: "macOS: `~/Library/Caches/Homebrew`, " \
"Linux: `$XDG_CACHE_HOME/Homebrew` or `~/.cache/Homebrew`.",
default: HOMEBREW_DEFAULT_CACHE,
},
HOMEBREW_CASK_OPTS: {
description: "Append these options to all `cask` commands. All `--*dir` options, " \
"`--language`, `--require-sha`, `--no-quarantine` and `--no-binaries` are supported. " \
"For example, you might add something like the following to your " \
"`${HOME}/.profile`, `${HOME}/.bash_profile`, or `${HOME}/.zshenv`:" \
"`~/.profile`, `~/.bash_profile`, or `~/.zshenv`:" \
"\n\n `export HOMEBREW_CASK_OPTS=\"--appdir=${HOME}/Applications --fontdir=/Library/Fonts\"`",
},
HOMEBREW_CLEANUP_MAX_AGE_DAYS: {
Expand Down Expand Up @@ -317,7 +317,7 @@ module EnvConfig
description: "Consult this file for the list of formulae to check by default when no formula argument " \
"is passed to `brew livecheck`.",
default_text: "`${XDG_CONFIG_HOME}/homebrew/livecheck_watchlist.txt` if `$XDG_CONFIG_HOME` is set " \
"or `${HOME}/.homebrew/livecheck_watchlist.txt` otherwise.",
"or `~/.homebrew/livecheck_watchlist.txt` otherwise.",
default: "#{ENV.fetch("HOMEBREW_USER_CONFIG_HOME")}/livecheck_watchlist.txt",
},
HOMEBREW_LOCK_CONTEXT: {
Expand All @@ -326,8 +326,8 @@ module EnvConfig
},
HOMEBREW_LOGS: {
description: "Use this directory to store log files.",
default_text: "macOS: `${HOME}/Library/Logs/Homebrew`, " \
"Linux: `${XDG_CACHE_HOME}/Homebrew/Logs` or `${HOME}/.cache/Homebrew/Logs`.",
default_text: "macOS: `~/Library/Logs/Homebrew`, " \
"Linux: `${XDG_CACHE_HOME}/Homebrew/Logs` or `~/.cache/Homebrew/Logs`.",
default: HOMEBREW_DEFAULT_LOGS,
},
HOMEBREW_MAKE_JOBS: {
Expand Down Expand Up @@ -450,9 +450,9 @@ module EnvConfig
boolean: true,
},
HOMEBREW_SSH_CONFIG_PATH: {
description: "If set, Homebrew will use the given config file instead of `${HOME}/.ssh/config` when " \
description: "If set, Homebrew will use the given config file instead of `~/.ssh/config` when " \
"fetching Git repositories over SSH.",
default_text: "`${HOME}/.ssh/config`",
default_text: "`~/.ssh/config`",
},
HOMEBREW_SUDO_THROUGH_SUDO_USER: {
description: "If set, Homebrew will use the `SUDO_USER` environment variable to define the user to " \
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ def etc
end

# A subdirectory of `etc` with the formula name suffixed.
# e.g. `${HOMEBREW_PREFIX}/etc/[email protected]`
# e.g. `$HOMEBREW_PREFIX/etc/[email protected]`
# Anything using `pkgetc.install` will not overwrite other files on
# e.g. upgrades but will write a new file named `*.default`.
#
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/manpages/brew.1.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ files:

* `/etc/homebrew/brew.env` (system-wide)

* `$HOMEBREW_PREFIX/etc/homebrew/brew.env` (prefix-specific)
* `${HOMEBREW_PREFIX}/etc/homebrew/brew.env` (prefix-specific)

* `$XDG_CONFIG_HOME/homebrew/brew.env` if `$XDG_CONFIG_HOME` is set or
`$HOME/.homebrew/brew.env` otherwise (user-specific)
`~/.homebrew/brew.env` otherwise (user-specific)

User-specific environment files take precedence over prefix-specific files and
prefix-specific files take precedence over system-wide files (unless
Expand Down
Loading

0 comments on commit 23facb2

Please sign in to comment.