Fix "Failed to eject" errors with DMGs

Use "diskutil unmount force" to unmount DMGs.
This commit is contained in:
Trevor Powell 2017-01-22 22:52:11 -06:00 committed by GitHub
parent 6f305ad3dc
commit 4ce6616f2e

View File

@ -45,10 +45,10 @@ module Hbc
begin
tries ||= 2
@command.run("/usr/sbin/diskutil",
args: ["eject", mountpath],
args: ["unmount", "force", mountpath],
print_stderr: false)
raise CaskError, "Failed to eject #{mountpath}" if mountpath.exist?
raise CaskError, "Failed to unmount #{mountpath}" if mountpath.exist?
rescue CaskError => e
raise e if (tries -= 1).zero?
sleep 1