add library method to detect beta
This commit is contained in:
Родитель
23c68439af
Коммит
db6daaa77c
|
@ -42,6 +42,10 @@ module MacOS
|
|||
shell_out('defaults -currentHost read-type com.apple.screensaver idleTime', user: @user).stdout.chomp == 'Type is integer'
|
||||
end
|
||||
end
|
||||
|
||||
def beta?
|
||||
node['platform_version'].chars.last.match?(/0/) && node['platform_build'].chars.last.match?(/[[:alpha:]]/)
|
||||
end
|
||||
end
|
||||
end
|
||||
Chef::Resource.include(MacOS::System)
|
||||
|
|
|
@ -3,13 +3,12 @@ unified_mode true
|
|||
provides :command_line_tools
|
||||
|
||||
property :name, String, default: ''
|
||||
property :beta, [true, false], default: false
|
||||
property :compile_time, [true, false],
|
||||
description: 'Install the Xcode Command Line Tools at compile time.',
|
||||
default: false, desired_state: false
|
||||
|
||||
action :install do
|
||||
if new_resource.beta
|
||||
if MacOS.beta?
|
||||
directory 'create CLT folder' do
|
||||
path '/Library/Developer/CommandLineTools'
|
||||
recursive true
|
||||
|
@ -42,7 +41,7 @@ action :install do
|
|||
end
|
||||
|
||||
action :upgrade do
|
||||
if new_resource.beta
|
||||
if MacOS.beta?
|
||||
file 'create CLT folder' do
|
||||
path '/Library/Developer/CommandLineTools'
|
||||
recursive true
|
||||
|
|
Загрузка…
Ссылка в новой задаче