Method: ChefApply::TargetHost::MacOS#install_package

Defined in:
lib/chef_apply/target_host/macos.rb

#install_package(remote_path) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/chef_apply/target_host/macos.rb', line 38

def install_package(remote_path)
  install_cmd = <<-EOS
  hdiutil detach "/Volumes/chef_software" >/dev/null 2>&1 || true
  hdiutil attach #{remote_path} -mountpoint "/Volumes/chef_software"
  cd / && sudo /usr/sbin/installer -pkg `sudo find "/Volumes/chef_software" -name \\*.pkg` -target /
  EOS
  run_command!(install_cmd)
  nil
end