diff --git a/Library/Homebrew/cask/lib/hbc/container/dmg.rb b/Library/Homebrew/cask/lib/hbc/container/dmg.rb index 987455ad72..49543844aa 100644 --- a/Library/Homebrew/cask/lib/hbc/container/dmg.rb +++ b/Library/Homebrew/cask/lib/hbc/container/dmg.rb @@ -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