Fix "Failed to eject" errors with DMGs
Use "diskutil unmount force" to unmount DMGs.
This commit is contained in:
parent
6f305ad3dc
commit
4ce6616f2e
@ -45,10 +45,10 @@ module Hbc
|
|||||||
begin
|
begin
|
||||||
tries ||= 2
|
tries ||= 2
|
||||||
@command.run("/usr/sbin/diskutil",
|
@command.run("/usr/sbin/diskutil",
|
||||||
args: ["eject", mountpath],
|
args: ["unmount", "force", mountpath],
|
||||||
print_stderr: false)
|
print_stderr: false)
|
||||||
|
|
||||||
raise CaskError, "Failed to eject #{mountpath}" if mountpath.exist?
|
raise CaskError, "Failed to unmount #{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