feat: add os_version for casks
This commit is contained in:
parent
55b07d7fed
commit
ab2b18f78c
@ -452,6 +452,7 @@ module Cask
|
|||||||
@artifacts ||= ArtifactSet.new
|
@artifacts ||= ArtifactSet.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(Pathname) }
|
||||||
def caskroom_path
|
def caskroom_path
|
||||||
cask.caskroom_path
|
cask.caskroom_path
|
||||||
end
|
end
|
||||||
@ -459,6 +460,7 @@ module Cask
|
|||||||
# The staged location for this cask, including version number.
|
# The staged location for this cask, including version number.
|
||||||
#
|
#
|
||||||
# @api public
|
# @api public
|
||||||
|
sig { returns(Pathname) }
|
||||||
def staged_path
|
def staged_path
|
||||||
return @staged_path if @staged_path
|
return @staged_path if @staged_path
|
||||||
|
|
||||||
@ -590,9 +592,15 @@ module Cask
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T.nilable(MacOSVersion)) }
|
||||||
|
def os_version
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
# The directory `app`s are installed into.
|
# The directory `app`s are installed into.
|
||||||
#
|
#
|
||||||
# @api public
|
# @api public
|
||||||
|
sig { returns(T.any(Pathname, String)) }
|
||||||
def appdir
|
def appdir
|
||||||
return HOMEBREW_CASK_APPDIR_PLACEHOLDER if Cask.generating_hash?
|
return HOMEBREW_CASK_APPDIR_PLACEHOLDER if Cask.generating_hash?
|
||||||
|
|
||||||
|
|||||||
4
Library/Homebrew/extend/os/cask/dsl.rb
Normal file
4
Library/Homebrew/extend/os/cask/dsl.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# typed: strict
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "extend/os/mac/cask/dsl" if OS.mac?
|
||||||
23
Library/Homebrew/extend/os/mac/cask/dsl.rb
Normal file
23
Library/Homebrew/extend/os/mac/cask/dsl.rb
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# typed: strict
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "cask/macos"
|
||||||
|
|
||||||
|
module OS
|
||||||
|
module Mac
|
||||||
|
module Cask
|
||||||
|
module DSL
|
||||||
|
extend T::Helpers
|
||||||
|
|
||||||
|
requires_ancestor { ::Cask::DSL }
|
||||||
|
|
||||||
|
sig { returns(T.nilable(MacOSVersion)) }
|
||||||
|
def os_version
|
||||||
|
MacOS.full_version
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Cask::DSL.prepend(OS::Mac::Cask::DSL)
|
||||||
Loading…
x
Reference in New Issue
Block a user