summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-28 14:16:38 -0700
committerTim Smith <tsmith@chef.io>2018-10-28 14:16:38 -0700
commit088a32b9adb00053d752713605be41b1bbb3e2f3 (patch)
tree80054a7095ced8c58a937cc0fba60627e94d330b /lib
parent4663521024484c05b19a0e62a5dcc3a6ed0a353c (diff)
downloadchef-088a32b9adb00053d752713605be41b1bbb3e2f3.tar.gz
Use full path to hdiutil and prevent finder opening the mounted dmg window
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/dmg_package.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index 056b58b812..76eb8dd193 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -106,12 +106,12 @@ class Chef
ruby_block "attach #{dmg_file}" do
block do
# example hdiutil imageinfo output: http://rubular.com/r/0xvOaA6d8B
- software_license_agreement = /Software License Agreement: true/.match?(shell_out!("hdiutil imageinfo #{passphrase_cmd} '#{dmg_file}'").stdout)
+ software_license_agreement = /Software License Agreement: true/.match?(shell_out!("/usr/bin/hdiutil imageinfo #{passphrase_cmd} '#{dmg_file}'").stdout)
raise "Requires EULA Acceptance; add 'accept_eula true' to dmg_package resource" if software_license_agreement && !new_resource.accept_eula
accept_eula_cmd = new_resource.accept_eula ? "echo Y | PAGER=true" : ""
- shell_out!("#{accept_eula_cmd} hdiutil attach #{passphrase_cmd} '#{dmg_file}' -mountpoint '/Volumes/#{volumes_dir}' -quiet")
+ shell_out!("#{accept_eula_cmd} /usr/bin/hdiutil attach #{passphrase_cmd} '#{dmg_file}' -nobrowse -mountpoint '/Volumes/#{volumes_dir}' -quiet")
end
- not_if "hdiutil info #{passphrase_cmd} | grep -q 'image-path.*#{dmg_file}'"
+ not_if "/usr/bin/hdiutil info #{passphrase_cmd} | grep -q 'image-path.*#{dmg_file}'"
end
case new_resource.type
@@ -134,7 +134,7 @@ class Chef
end
end
- execute "hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volumes_dir}' -force"
+ execute "/usr/bin/hdiutil detach '/Volumes/#{volumes_dir}' || /usr/bin/hdiutil detach '/Volumes/#{volumes_dir}' -force"
end
end