Merge pull request #1897 from trevorpowell/master
Proposed fix for "Failed to eject" errors with DMGs
This commit is contained in:
commit
01c1372074
@ -43,11 +43,16 @@ module Hbc
|
|||||||
next unless mountpath.exist?
|
next unless mountpath.exist?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
tries ||= 2
|
tries ||= 3
|
||||||
@command.run("/usr/sbin/diskutil",
|
if tries > 1
|
||||||
args: ["eject", mountpath],
|
@command.run("/usr/sbin/diskutil",
|
||||||
print_stderr: false)
|
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?
|
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?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user