summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-28 14:16:38 -0700
committerTim Smith <tsmith@chef.io>2018-10-31 12:37:20 -0700
commit207928123a26fbb465e147be20b1b46114ae5a69 (patch)
tree6331f59bdb24767682b3f3747523e59b49e5ad86
parentc1c83654dd0632898f4774328fac32c920d5e0cf (diff)
downloadchef-207928123a26fbb465e147be20b1b46114ae5a69.tar.gz
Use full path to hdiutil and prevent finder opening the mounted dmg window
Signed-off-by: Tim Smith <tsmith@chef.io>
-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