aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-28 13:38:49 +0100
committerMarkus Reiter2016-11-28 13:38:49 +0100
commit9a29bd35e6d6e1a446c02b14d43b6dd52733821e (patch)
tree39d15aec1fb889d8a024f0f728d4ab6915d22b4a /Library
parent3bcf80f651f8f25db33339782a8b0aed3ad8a3eb (diff)
downloadbrew-9a29bd35e6d6e1a446c02b14d43b6dd52733821e.tar.bz2
Fail if cask source already exists.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb3
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/install.rb2
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