mirror of
https://github.com/Homebrew/brew.git
synced 2026-08-12 22:29:27 +04:00
HOMEBREW_NO_INSTALL_FROM_API disables HOMEBREW_USE_INTERNAL_API
This commit is contained in:
@@ -575,6 +575,7 @@ module Homebrew
|
||||
:HOMEBREW_CASK_OPTS,
|
||||
:HOMEBREW_FORBID_PACKAGES_FROM_PATHS,
|
||||
:HOMEBREW_DOWNLOAD_CONCURRENCY,
|
||||
:HOMEBREW_USE_INTERNAL_API,
|
||||
]).freeze, T::Set[Symbol])
|
||||
|
||||
FALSY_VALUES = T.let(%w[false no off nil 0].freeze, T::Array[String])
|
||||
@@ -679,5 +680,13 @@ module Homebrew
|
||||
|
||||
[concurrency, 1].max
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def use_internal_api?
|
||||
return false if Homebrew::EnvConfig.no_install_from_api?
|
||||
|
||||
use_internal_api = ENV.fetch("HOMEBREW_USE_INTERNAL_API", nil)
|
||||
use_internal_api.present? && FALSY_VALUES.exclude?(use_internal_api.downcase)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -316,9 +316,6 @@ module Homebrew::EnvConfig
|
||||
sig { returns(T.nilable(::String)) }
|
||||
def upgrade_greedy_casks; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def use_internal_api?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def verbose?; end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user