Skip to content

Commit

Permalink
Merge pull request #897 from chef/jsinha/fix_dmg
Browse files Browse the repository at this point in the history
Unmount dmg before detaching
  • Loading branch information
scotthain authored Aug 28, 2019
2 parents c4c0c51 + 06adefd commit ab39cf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/omnibus/compressors/dmg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def compress_dmg
shellout! <<-EOH.gsub(/^ {10}/, "")
chmod -Rf go-w "/Volumes/#{volume_name}"
sync
hdiutil unmount "#{@device}"
# Give some time to the system so unmount dmg
sleep 5
hdiutil detach "#{@device}" && \
hdiutil convert \\
"#{writable_dmg}" \\
Expand Down
3 changes: 3 additions & 0 deletions spec/unit/compressors/dmg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ module Omnibus
.with <<-EOH.gsub(/^ {12}/, "")
chmod -Rf go-w "/Volumes/Project One"
sync
hdiutil unmount "#{device}"
# Give some time to the system so unmount dmg
sleep 5
hdiutil detach "#{device}" &&\
hdiutil convert \\
"#{staging_dir}/project-writable.dmg" \\
Expand Down

0 comments on commit ab39cf0

Please sign in to comment.