Skip to content

Commit d2eb9c4

Browse files
Merge pull request #20364 from Homebrew/var-notation
output: express environment variables consistently
2 parents 9e4beda + 6255263 commit d2eb9c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+87
-81
lines changed

Library/Homebrew/bundle/commands/exec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def self.run(*args, global: false, file: nil, subcommand: "", services: false, c
180180
<<~EOS
181181
Your shell has been configured to use a build environment from your `Brewfile`.
182182
This should help you build stuff.
183-
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
183+
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
184184
When done, type `exit`.
185185
EOS
186186
end

Library/Homebrew/cask/cask.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Cask
3232

3333
def self.all(eval_all: false)
3434
if !eval_all && !Homebrew::EnvConfig.eval_all?
35-
raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL"
35+
raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or `HOMEBREW_EVAL_ALL=1`"
3636
end
3737

3838
# Load core casks from tokens so they load from the API when the core cask is not tapped.

Library/Homebrew/cask/installer.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def verify_has_sha
248248

249249
raise CaskError, <<~EOS
250250
Cask '#{@cask}' does not have a sha256 checksum defined and was not installed.
251-
This means you have the #{Formatter.identifier("--require-sha")} option set, perhaps in your HOMEBREW_CASK_OPTS.
251+
This means you have the #{Formatter.identifier("--require-sha")} option set, perhaps in your `$HOMEBREW_CASK_OPTS`.
252252
EOS
253253
end
254254

@@ -703,9 +703,9 @@ def forbidden_tap_check
703703
dep_full_name = cask_or_formula.full_name
704704
error_message = "The installation of #{@cask} has a dependency #{dep_full_name}\n" \
705705
"from the #{dep_tap} tap but #{owner} "
706-
error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless dep_tap.allowed_by_env?
706+
error_message << "has not allowed this tap in `$HOMEBREW_ALLOWED_TAPS`" unless dep_tap.allowed_by_env?
707707
error_message << " and\n" if !dep_tap.allowed_by_env? && dep_tap.forbidden_by_env?
708-
error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if dep_tap.forbidden_by_env?
708+
error_message << "has forbidden this tap in `$HOMEBREW_FORBIDDEN_TAPS`" if dep_tap.forbidden_by_env?
709709
error_message << ".#{owner_contact}"
710710

711711
raise CaskCannotBeInstalledError.new(@cask, error_message)
@@ -717,9 +717,9 @@ def forbidden_tap_check
717717

718718
error_message = "The installation of #{@cask.full_name} has the tap #{cask_tap}\n" \
719719
"but #{owner} "
720-
error_message << "has not allowed this tap in `HOMEBREW_ALLOWED_TAPS`" unless cask_tap.allowed_by_env?
720+
error_message << "has not allowed this tap in `$HOMEBREW_ALLOWED_TAPS`" unless cask_tap.allowed_by_env?
721721
error_message << " and\n" if !cask_tap.allowed_by_env? && cask_tap.forbidden_by_env?
722-
error_message << "has forbidden this tap in `HOMEBREW_FORBIDDEN_TAPS`" if cask_tap.forbidden_by_env?
722+
error_message << "has forbidden this tap in `$HOMEBREW_FORBIDDEN_TAPS`" if cask_tap.forbidden_by_env?
723723
error_message << ".#{owner_contact}"
724724

725725
raise CaskCannotBeInstalledError.new(@cask, error_message)

Library/Homebrew/cleanup.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ def self.puts_no_install_cleanup_disable_message
258258
return if Homebrew::EnvConfig.no_env_hints?
259259
return if Homebrew::EnvConfig.no_install_cleanup?
260260

261-
puts "Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP."
262-
puts "Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`)."
261+
puts "Disable this behaviour by setting `HOMEBREW_NO_INSTALL_CLEANUP=1`."
262+
puts "Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`)."
263263
end
264264

265265
def self.puts_no_install_cleanup_disable_message_if_not_already!
@@ -315,8 +315,8 @@ def clean!(quiet: false, periodic: false)
315315
end
316316

317317
if ENV["HOMEBREW_AUTOREMOVE"].present?
318-
opoo "HOMEBREW_AUTOREMOVE is now a no-op as it is the default behaviour. " \
319-
"Set HOMEBREW_NO_AUTOREMOVE=1 to disable it."
318+
opoo "`$HOMEBREW_AUTOREMOVE` is now a no-op as it is the default behaviour. " \
319+
"Set `HOMEBREW_NO_AUTOREMOVE=1` to disable it."
320320
end
321321
Cleanup.autoremove(dry_run: dry_run?) unless Homebrew::EnvConfig.no_autoremove?
322322

Library/Homebrew/cmd/deps.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def run
130130
opoo <<~EOS
131131
`brew deps` is not the actual runtime dependencies because #{not_using_runtime_dependencies_reason}!
132132
This means dependencies may differ from a formula's declared dependencies.
133-
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
133+
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
134134
EOS
135135
end
136136

Library/Homebrew/cmd/desc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def run
4949

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

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

Library/Homebrew/cmd/gist-logs.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def gistify_logs(formula)
6363
files["00.tap.out"] = { content: tap }
6464
end
6565

66-
odie "`brew gist-logs` requires HOMEBREW_GITHUB_API_TOKEN to be set!" if GitHub::API.credentials_type == :none
66+
if GitHub::API.credentials_type == :none
67+
odie "`brew gist-logs` requires `$HOMEBREW_GITHUB_API_TOKEN` to be set!"
68+
end
6769

6870
# Description formatted to work well as page title when viewing gist
6971
descr = if formula.core_formula?

Library/Homebrew/cmd/readall.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def run
5050

5151
taps = if args.no_named?
5252
unless args.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=1` set!"
5454
end
5555

5656
Tap.installed

Library/Homebrew/cmd/search.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def run
7272

7373
if args.desc?
7474
if !args.eval_all? && Homebrew::EnvConfig.no_install_from_api?
75-
raise UsageError, "`brew search --desc` needs `--eval-all` passed or `$HOMEBREW_EVAL_ALL` set!"
75+
raise UsageError, "`brew search --desc` needs `--eval-all` passed or `HOMEBREW_EVAL_ALL=1` set!"
7676
end
7777

7878
Search.search_descriptions(string_or_regex, args)

Library/Homebrew/cmd/uninstall.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def run
7878
end
7979

8080
if ENV["HOMEBREW_AUTOREMOVE"].present?
81-
opoo "HOMEBREW_AUTOREMOVE is now a no-op as it is the default behaviour. " \
82-
"Set HOMEBREW_NO_AUTOREMOVE=1 to disable it."
81+
opoo "`$HOMEBREW_AUTOREMOVE` is now a no-op as it is the default behaviour. " \
82+
"Set `HOMEBREW_NO_AUTOREMOVE=1` to disable it."
8383
end
8484
Cleanup.autoremove unless Homebrew::EnvConfig.no_autoremove?
8585
end

0 commit comments

Comments
 (0)