aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/exceptions.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-10-01 23:18:13 +0200
committerMarkus Reiter2016-10-02 19:53:43 +0200
commit082bd5e98ae7592bc92466186609066e00c2bf84 (patch)
tree6afaa394d36b9d21517a41e47264ffb9c63780f8 /Library/Homebrew/cask/lib/hbc/exceptions.rb
parent564fa8867dd865c686d243ba48c202e0cb6a35fe (diff)
downloadbrew-082bd5e98ae7592bc92466186609066e00c2bf84.tar.bz2
Change `A Cask for #{token} is already installed.` message.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/exceptions.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/exceptions.rb23
1 files changed, 20 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/exceptions.rb b/Library/Homebrew/cask/lib/hbc/exceptions.rb
index f77106d92..2f63366ca 100644
--- a/Library/Homebrew/cask/lib/hbc/exceptions.rb
+++ b/Library/Homebrew/cask/lib/hbc/exceptions.rb
@@ -29,13 +29,30 @@ module Hbc
class CaskAlreadyInstalledError < AbstractCaskErrorWithToken
def to_s
- %Q{A Cask for #{token} is already installed. Add the "--force" option to force re-install.}
+ s = <<-EOS.undent
+ A Cask for #{token} is already installed.
+ EOS
+
+ s.concat("\n").concat(reinstall_message)
+ end
+
+ private
+
+ def reinstall_message
+ <<-EOS.undent
+ To re-install #{token}, run:
+ brew cask uninstall --force #{token}; brew cask install #{token}
+ EOS
end
end
- class CaskAutoUpdatesError < AbstractCaskErrorWithToken
+ class CaskAlreadyInstalledAutoUpdatesError < CaskAlreadyInstalledError
def to_s
- %Q{A Cask for #{token} is already installed and using auto-updates. Add the "--force" option to force re-install.}
+ s = <<-EOS.undent
+ A Cask for #{token} is already installed and using auto-updates.
+ EOS
+
+ s.concat("\n").concat(reinstall_message)
end
end