Merge pull request #16043 from MikeMcQuaid/cli_parser_env_external_commands
cli/parser: check env var directly if there's no `EnvConfig` method.
This commit is contained in:
commit
d799bd449c
@ -185,7 +185,12 @@ module Homebrew
|
|||||||
def env?(env)
|
def env?(env)
|
||||||
return if env.blank?
|
return if env.blank?
|
||||||
|
|
||||||
Homebrew::EnvConfig.try(:"#{env}?")
|
method_name = :"#{env}?"
|
||||||
|
if Homebrew::EnvConfig.respond_to?(method_name)
|
||||||
|
Homebrew::EnvConfig.public_send(method_name)
|
||||||
|
else
|
||||||
|
ENV.fetch("HOMEBREW_#{env.upcase}", nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def description(text = nil)
|
def description(text = nil)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user