diff options
| author | Markus Reiter | 2016-11-28 13:38:49 +0100 |
|---|---|---|
| committer | Markus Reiter | 2016-11-28 13:38:49 +0100 |
| commit | 9a29bd35e6d6e1a446c02b14d43b6dd52733821e (patch) | |
| tree | 39d15aec1fb889d8a024f0f728d4ab6915d22b4a /Library | |
| parent | 3bcf80f651f8f25db33339782a8b0aed3ad8a3eb (diff) | |
| download | brew-9a29bd35e6d6e1a446c02b14d43b6dd52733821e.tar.bz2 | |
Fail if cask source already exists.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/install.rb | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb index f1e542e7a..7322924e8 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb @@ -45,8 +45,7 @@ module Hbc if force ohai(warning_target_exists { |s| s << "overwriting." }) else - ohai(warning_target_exists { |s| s << "not moving." }) - return false + raise CaskError, warning_target_exists << "." end end unless source.exist? diff --git a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb index 32d8d6840..69b388425 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb @@ -39,7 +39,7 @@ module Hbc def preflight_checks(source, target) if target.exist? && !self.class.islink?(target) - ohai "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking." + opoo "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking." return false end unless source.exist? diff --git a/Library/Homebrew/cask/lib/hbc/cli/install.rb b/Library/Homebrew/cask/lib/hbc/cli/install.rb index 3e9ce4e4f..3f4c94b6b 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/install.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/install.rb @@ -35,6 +35,8 @@ module Hbc rescue CaskNoShasumError => e opoo e.message count += 1 + rescue CaskError => e + onoe e.message end end count.zero? ? nil : count == cask_tokens.length |
