livecheck: fix implicit no-api handling
This commit is contained in:
parent
5b30de880d
commit
54a1f2005a
@ -113,11 +113,13 @@ module Homebrew
|
||||
return [nil, references] if livecheck_formula.blank? && livecheck_cask.blank?
|
||||
|
||||
# Load the referenced formula or cask
|
||||
referenced_formula_or_cask = if livecheck_formula
|
||||
referenced_formula_or_cask = Homebrew.with_no_api_env do
|
||||
if livecheck_formula
|
||||
Formulary.factory(livecheck_formula)
|
||||
elsif livecheck_cask
|
||||
Cask::CaskLoader.load(livecheck_cask)
|
||||
end
|
||||
end
|
||||
|
||||
# Error if a `livecheck` block references a formula/cask that was already
|
||||
# referenced (or itself)
|
||||
|
@ -104,7 +104,7 @@ module Homebrew
|
||||
|
||||
unversioned_cask_checker = if url.present? && url != cask.url.to_s
|
||||
# Create a copy of the `cask` that uses the `livecheck` block URL
|
||||
cask_copy = Cask::CaskLoader.load(cask.full_name)
|
||||
cask_copy = Cask::CaskLoader.load(cask.sourcefile_path)
|
||||
cask_copy.allow_reassignment = true
|
||||
cask_copy.url { url }
|
||||
UnversionedCaskChecker.new(cask_copy)
|
||||
|
Loading…
x
Reference in New Issue
Block a user