Merge pull request #11742 from carlocab/pour-default-prefix

formula: add `:default_prefix` as a standard `pour_bottle?` requirement
This commit is contained in:
Carlo Cabrera 2021-07-20 09:34:58 +08:00 committed by GitHub
commit 349a485886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3016,6 +3016,13 @@ class Formula
T.cast(self, PourBottleCheck).satisfy { MacOS::CLT.installed? }
end
end
when :default_prefix
lambda do |_|
T.cast(self, PourBottleCheck).reason(+<<~EOS)
The bottle needs to be installed into #{Homebrew::DEFAULT_PREFIX}.
EOS
T.cast(self, PourBottleCheck).satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX }
end
else
raise ArgumentError, "Invalid preset `pour_bottle?` condition" if only_if.present?
end