aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask
diff options
context:
space:
mode:
authorMarkus Reiter2016-11-28 13:55:51 +0100
committerMarkus Reiter2016-11-28 14:01:06 +0100
commite63efb3fe48523d1a24bb5d2771af73fa74dca6b (patch)
tree52b4004431b849f9d7ab1cf0bc1d0a3ed23d7b85 /Library/Homebrew/cask
parent9a29bd35e6d6e1a446c02b14d43b6dd52733821e (diff)
downloadbrew-e63efb3fe48523d1a24bb5d2771af73fa74dca6b.tar.bz2
Warn when overwriting an artifact.
Diffstat (limited to 'Library/Homebrew/cask')
-rw-r--r--Library/Homebrew/cask/lib/hbc/artifact/moved.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
index 7322924e8..64756fd93 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/moved.rb
@@ -42,11 +42,8 @@ module Hbc
def preflight_checks
if Utils.path_occupied?(target)
- if force
- ohai(warning_target_exists { |s| s << "overwriting." })
- else
- raise CaskError, warning_target_exists << "."
- end
+ raise CaskError, warning_target_exists << "." unless force
+ opoo(warning_target_exists { |s| s << "overwriting." })
end
unless source.exist?
message = "It seems the #{self.class.artifact_english_name} source is not there: '#{source}'"