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?
|
next unless mountpath.exist?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
tries ||= 2
|
tries ||= 3
|
||||||
|
if tries > 1
|
||||||
|
@command.run("/usr/sbin/diskutil",
|
||||||
|
args: ["eject", mountpath],
|
||||||
|
print_stderr: false)
|
||||||
|
else
|
||||||
@command.run("/usr/sbin/diskutil",
|
@command.run("/usr/sbin/diskutil",
|
||||||
args: ["unmount", "force", mountpath],
|
args: ["unmount", "force", mountpath],
|
||||||
print_stderr: false)
|
print_stderr: false)
|
||||||
|
end
|
||||||
raise CaskError, "Failed to unmount #{mountpath}" if mountpath.exist?
|
raise CaskError, "Failed to eject #{mountpath}" if mountpath.exist?
|
||||||
rescue CaskError => e
|
rescue CaskError => e
|
||||||
raise e if (tries -= 1).zero?
|
raise e if (tries -= 1).zero?
|
||||||
sleep 1
|
sleep 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user