Add implicit macOS dependency to casks without explicit depends_on stanza

This commit is contained in:
Rylan Polster 2025-02-05 10:26:50 -05:00 committed by Sean Molenaar
parent a28fde1a8c
commit f874603a21
3 changed files with 14 additions and 1 deletions

View File

@ -114,6 +114,7 @@ module Cask
return unless @block
@dsl.instance_eval(&@block)
@dsl.add_implicit_macos_dependency
@dsl.language_eval
end

View File

@ -390,6 +390,13 @@ module Cask
@depends_on
end
# @api private
def add_implicit_macos_dependency
return if @depends_on.present? && @depends_on.macos.present?
depends_on macos: ">= :#{MacOSVersion::SYMBOLS.key MacOSVersion::SYMBOLS.values.min}"
end
# Declare conflicts that keep a cask from installing or working correctly.
#
# @api public

View File

@ -76,7 +76,12 @@
"depends_on": {
"cask": [
"something"
]
],
"macos": {
">=": [
"10.11"
]
}
},
"conflicts_with": {
"formula": [