From e63efb3fe48523d1a24bb5d2771af73fa74dca6b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 28 Nov 2016 13:55:51 +0100 Subject: [PATCH] Warn when overwriting an artifact. --- Library/Homebrew/cask/lib/hbc/artifact/moved.rb | 7 ++----- 1 file 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 7322924e85..64756fd935 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}'"