Decouple the local bottle strategy from the formula
This commit is contained in:
parent
321476df08
commit
f13ac9b0c8
@ -417,8 +417,8 @@ end
|
|||||||
class LocalBottleDownloadStrategy < AbstractFileDownloadStrategy
|
class LocalBottleDownloadStrategy < AbstractFileDownloadStrategy
|
||||||
attr_reader :cached_location
|
attr_reader :cached_location
|
||||||
|
|
||||||
def initialize(formula)
|
def initialize(path)
|
||||||
@cached_location = formula.local_bottle_path
|
@cached_location = path
|
||||||
end
|
end
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
|
@ -610,8 +610,8 @@ class FormulaInstaller
|
|||||||
return if Homebrew::Hooks::Bottles.pour_formula_bottle(formula)
|
return if Homebrew::Hooks::Bottles.pour_formula_bottle(formula)
|
||||||
end
|
end
|
||||||
|
|
||||||
if formula.local_bottle_path
|
if (bottle_path = formula.local_bottle_path)
|
||||||
downloader = LocalBottleDownloadStrategy.new(formula)
|
downloader = LocalBottleDownloadStrategy.new(bottle_path)
|
||||||
else
|
else
|
||||||
downloader = formula.bottle
|
downloader = formula.bottle
|
||||||
downloader.verify_download_integrity(downloader.fetch)
|
downloader.verify_download_integrity(downloader.fetch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user