brew/Library/Homebrew/extend/os/mac/formula_installer.rb

21 lines
512 B
Ruby
Raw Normal View History

# typed: strict
# 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 }
2024-09-18 15:33:49 -07:00
sig { params(formula: Formula).returns(T.nilable(T::Boolean)) }
def fresh_install?(formula)
!::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
end
end
2024-09-05 19:56:32 -07:00
2024-09-18 15:33:49 -07:00
FormulaInstaller.prepend(OS::Mac::FormulaInstaller)