Skip to content

Commit e21cbd6

Browse files
authored
Merge pull request #19153 from Homebrew/env_var_consistency
Use environment variables consistently
2 parents 9fd2b27 + bbf5a9f commit e21cbd6

File tree

24 files changed

+384
-369
lines changed

24 files changed

+384
-369
lines changed

Library/Homebrew/cask/config.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ class Config
1616
{
1717
appdir: "/Applications",
1818
keyboard_layoutdir: "/Library/Keyboard Layouts",
19-
colorpickerdir: "~/Library/ColorPickers",
20-
prefpanedir: "~/Library/PreferencePanes",
21-
qlplugindir: "~/Library/QuickLook",
22-
mdimporterdir: "~/Library/Spotlight",
23-
dictionarydir: "~/Library/Dictionaries",
24-
fontdir: "~/Library/Fonts",
25-
servicedir: "~/Library/Services",
26-
input_methoddir: "~/Library/Input Methods",
27-
internet_plugindir: "~/Library/Internet Plug-Ins",
28-
audio_unit_plugindir: "~/Library/Audio/Plug-Ins/Components",
29-
vst_plugindir: "~/Library/Audio/Plug-Ins/VST",
30-
vst3_plugindir: "~/Library/Audio/Plug-Ins/VST3",
31-
screen_saverdir: "~/Library/Screen Savers",
19+
colorpickerdir: "${HOME}/Library/ColorPickers",
20+
prefpanedir: "${HOME}/Library/PreferencePanes",
21+
qlplugindir: "${HOME}/Library/QuickLook",
22+
mdimporterdir: "${HOME}/Library/Spotlight",
23+
dictionarydir: "${HOME}/Library/Dictionaries",
24+
fontdir: "${HOME}/Library/Fonts",
25+
servicedir: "${HOME}/Library/Services",
26+
input_methoddir: "${HOME}/Library/Input Methods",
27+
internet_plugindir: "${HOME}/Library/Internet Plug-Ins",
28+
audio_unit_plugindir: "${HOME}/Library/Audio/Plug-Ins/Components",
29+
vst_plugindir: "${HOME}/Library/Audio/Plug-Ins/VST",
30+
vst3_plugindir: "${HOME}/Library/Audio/Plug-Ins/VST3",
31+
screen_saverdir: "${HOME}/Library/Screen Savers",
3232
}.freeze,
3333
T::Hash[Symbol, String],
3434
)

Library/Homebrew/cmd/--cache.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.command_name = "--cache"
1515

1616
cmd_args do
1717
description <<~EOS
18-
Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
18+
Display Homebrew's download cache. See also `$HOMEBREW_CACHE`.
1919
2020
If a <formula> or <cask> is provided, display the file or directory used to cache it.
2121
EOS

Library/Homebrew/cmd/cleanup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CleanupCmd < AbstractCommand
1313
Remove stale lock files and outdated downloads for all formulae and casks,
1414
and remove old versions of installed formulae. If arguments are specified,
1515
only do this for the given formulae and casks. Removes all downloads more than
16-
#{days} days old. This can be adjusted with `HOMEBREW_CLEANUP_MAX_AGE_DAYS`.
16+
#{days} days old. This can be adjusted with `$HOMEBREW_CLEANUP_MAX_AGE_DAYS`.
1717
EOS
1818
flag "--prune=",
1919
description: "Remove all cache files older than specified <days>. " \

Library/Homebrew/cmd/desc.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Desc < AbstractCommand
2525
"it is interpreted as a regular expression."
2626
switch "--eval-all",
2727
description: "Evaluate all available formulae and casks, whether installed or not, to search their " \
28-
"descriptions. Implied if `HOMEBREW_EVAL_ALL` is set."
28+
"descriptions. Implied if `$HOMEBREW_EVAL_ALL` is set."
2929
switch "--formula", "--formulae",
3030
description: "Treat all named arguments as formulae."
3131
switch "--cask", "--casks",
@@ -48,7 +48,7 @@ def run
4848

4949
if search_type.present?
5050
if !args.eval_all? && !Homebrew::EnvConfig.eval_all? && Homebrew::EnvConfig.no_install_from_api?
51-
raise UsageError, "`brew desc --search` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!"
51+
raise UsageError, "`brew desc --search` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!"
5252
end
5353

5454
query = args.named.join(" ")

Library/Homebrew/cmd/info.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Info < AbstractCommand
2727
EOS
2828
switch "--analytics",
2929
description: "List global Homebrew analytics data or, if specified, installation and " \
30-
"build error data for <formula> (provided neither `HOMEBREW_NO_ANALYTICS` " \
31-
"nor `HOMEBREW_NO_GITHUB_API` are set)."
30+
"build error data for <formula> (provided neither `$HOMEBREW_NO_ANALYTICS` " \
31+
"nor `$HOMEBREW_NO_GITHUB_API` are set)."
3232
flag "--days=",
3333
depends_on: "--analytics",
3434
description: "How many days of analytics data to retrieve. " \
@@ -57,7 +57,7 @@ class Info < AbstractCommand
5757
switch "--eval-all",
5858
depends_on: "--json",
5959
description: "Evaluate all available formulae and casks, whether installed or not, to print their " \
60-
"JSON. Implied if `HOMEBREW_EVAL_ALL` is set."
60+
"JSON. Implied if `$HOMEBREW_EVAL_ALL` is set."
6161
switch "--variations",
6262
depends_on: "--json",
6363
description: "Include the variations hash in each formula's JSON output."

Library/Homebrew/cmd/install.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class InstallCmd < AbstractCommand
2020
Install a <formula> or <cask>. Additional options specific to a <formula> may be
2121
appended to the command.
2222
23-
Unless `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
23+
Unless `$HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
2424
outdated dependents and dependents with broken linkage, respectively.
2525
26-
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for
26+
Unless `$HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for
2727
the installed formulae or, every 30 days, for all formulae.
2828
29-
Unless `HOMEBREW_NO_INSTALL_UPGRADE` is set, `brew install` <formula> will upgrade <formula> if it
29+
Unless `$HOMEBREW_NO_INSTALL_UPGRADE` is set, `brew install` <formula> will upgrade <formula> if it
3030
is already installed but outdated.
3131
EOS
3232
switch "-d", "--debug",

Library/Homebrew/cmd/nodenv-sync.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Cmd
99
class NodenvSync < AbstractCommand
1010
cmd_args do
1111
description <<~EOS
12-
Create symlinks for Homebrew's installed NodeJS versions in `~/.nodenv/versions`.
12+
Create symlinks for Homebrew's installed NodeJS versions in `${HOME}/.nodenv/versions`.
1313
1414
Note that older version symlinks will also be created so e.g. NodeJS 19.1.0 will
1515
also be symlinked to 19.0.0.

Library/Homebrew/cmd/pyenv-sync.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Cmd
99
class PyenvSync < AbstractCommand
1010
cmd_args do
1111
description <<~EOS
12-
Create symlinks for Homebrew's installed Python versions in `~/.pyenv/versions`.
12+
Create symlinks for Homebrew's installed Python versions in `${HOME}/.pyenv/versions`.
1313
1414
Note that older patch version symlinks will be created and linked to the minor
1515
version so e.g. Python 3.11.0 will also be symlinked to 3.11.3.

Library/Homebrew/cmd/rbenv-sync.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Cmd
99
class RbenvSync < AbstractCommand
1010
cmd_args do
1111
description <<~EOS
12-
Create symlinks for Homebrew's installed Ruby versions in `~/.rbenv/versions`.
12+
Create symlinks for Homebrew's installed Ruby versions in `${HOME}/.rbenv/versions`.
1313
1414
Note that older version symlinks will also be created so e.g. Ruby 3.2.1 will
1515
also be symlinked to 3.2.0.

Library/Homebrew/cmd/readall.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ReadallCmd < AbstractCommand
2525
description: "Syntax-check all of Homebrew's Ruby files (if no <tap> is passed)."
2626
switch "--eval-all",
2727
description: "Evaluate all available formulae and casks, whether installed or not. " \
28-
"Implied if `HOMEBREW_EVAL_ALL` is set."
28+
"Implied if `$HOMEBREW_EVAL_ALL` is set."
2929
switch "--no-simulate",
3030
description: "Don't simulate other system configurations when checking formulae and casks."
3131

@@ -50,7 +50,7 @@ def run
5050

5151
taps = if args.no_named?
5252
if !args.eval_all? && !Homebrew::EnvConfig.eval_all?
53-
raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!"
53+
raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!"
5454
end
5555

5656
Tap.installed

0 commit comments

Comments
 (0)