2021-06-04 23:54:16 +03:00
|
|
|
unified_mode true
|
|
|
|
|
2020-06-19 00:04:50 +03:00
|
|
|
provides :command_line_tools
|
2019-01-18 03:45:23 +03:00
|
|
|
|
2020-03-05 03:47:32 +03:00
|
|
|
property :compile_time, [true, false],
|
2019-01-18 03:45:23 +03:00
|
|
|
description: 'Install the Xcode Command Line Tools at compile time.',
|
|
|
|
default: false, desired_state: false
|
|
|
|
|
|
|
|
action :install do
|
|
|
|
command_line_tools = CommandLineTools.new
|
|
|
|
|
|
|
|
execute "install #{command_line_tools.version}" do
|
|
|
|
command ['softwareupdate', '--install', command_line_tools.version]
|
|
|
|
not_if { ::File.exist?('/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib') }
|
|
|
|
live_stream true
|
|
|
|
end
|
|
|
|
|
2019-12-07 02:30:24 +03:00
|
|
|
file 'sentinel to request on-demand install' do
|
|
|
|
path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
|
|
|
|
action :delete
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
action :upgrade do
|
|
|
|
command_line_tools = CommandLineTools.new
|
|
|
|
|
|
|
|
execute "upgrade #{command_line_tools.version}" do
|
|
|
|
command ['softwareupdate', '--install', command_line_tools.latest_from_catalog]
|
|
|
|
not_if { command_line_tools.version == command_line_tools.latest_from_catalog }
|
|
|
|
live_stream true
|
|
|
|
end
|
|
|
|
|
|
|
|
file 'sentinel to request on-demand install' do
|
|
|
|
path '/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress'
|
2019-01-18 03:45:23 +03:00
|
|
|
action :delete
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def after_created
|
|
|
|
return unless compile_time
|
|
|
|
Array(action).each do |action|
|
|
|
|
run_action(action)
|
|
|
|
end
|
|
|
|
end
|