Update dmg.rb based on feedback
Try "diskutil eject" twice before "diskutil unmount force".
This commit is contained in:
parent
4ce6616f2e
commit
e11b8b68cd
@ -43,12 +43,17 @@ module Hbc
|
||||
next unless mountpath.exist?
|
||||
|
||||
begin
|
||||
tries ||= 2
|
||||
@command.run("/usr/sbin/diskutil",
|
||||
args: ["unmount", "force", mountpath],
|
||||
print_stderr: false)
|
||||
|
||||
raise CaskError, "Failed to unmount #{mountpath}" if mountpath.exist?
|
||||
tries ||= 3
|
||||
if tries > 1
|
||||
@command.run("/usr/sbin/diskutil",
|
||||
args: ["eject", mountpath],
|
||||
print_stderr: false)
|
||||
else
|
||||
@command.run("/usr/sbin/diskutil",
|
||||
args: ["unmount", "force", mountpath],
|
||||
print_stderr: false)
|
||||
end
|
||||
raise CaskError, "Failed to eject #{mountpath}" if mountpath.exist?
|
||||
rescue CaskError => e
|
||||
raise e if (tries -= 1).zero?
|
||||
sleep 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user