mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
22 lines
496 B
Ruby
22 lines
496 B
Ruby
# typed: true
|
|
# frozen_string_literal: true
|
|
|
|
module Homebrew
|
|
# @api private
|
|
module Fetch
|
|
extend T::Sig
|
|
|
|
sig { params(f: Formula, args: CLI::Args).returns(T::Boolean) }
|
|
def fetch_bottle?(f, args:)
|
|
bottle = f.bottle
|
|
|
|
return true if args.force_bottle? && bottle
|
|
return false unless bottle && f.pour_bottle?
|
|
return false if args.build_from_source_formulae.include?(f.full_name)
|
|
return false unless bottle.compatible_cellar?
|
|
|
|
true
|
|
end
|
|
end
|
|
end
|