2024-08-15 07:59:49 -07:00
|
|
|
# typed: strict
|
2022-11-21 22:08:11 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
module OS
|
|
|
|
module Mac
|
|
|
|
module FormulaInstaller
|
|
|
|
extend T::Helpers
|
2024-09-05 19:56:32 -07:00
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
requires_ancestor { ::FormulaInstaller }
|
2022-11-21 22:08:11 -08:00
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
sig { params(formula: Formula).returns(T.nilable(T::Boolean)) }
|
|
|
|
def fresh_install?(formula)
|
2024-09-21 12:24:21 -07:00
|
|
|
!::Homebrew::EnvConfig.developer? && !OS::Mac.version.outdated_release? &&
|
2024-09-18 15:33:49 -07:00
|
|
|
(!installed_as_dependency? || !formula.any_version_installed?)
|
2024-09-13 12:22:52 -07:00
|
|
|
end
|
|
|
|
end
|
2022-11-21 22:08:11 -08:00
|
|
|
end
|
|
|
|
end
|
2024-09-05 19:56:32 -07:00
|
|
|
|
2024-09-18 15:33:49 -07:00
|
|
|
FormulaInstaller.prepend(OS::Mac::FormulaInstaller)
|