From e0b93f1537248d142b1fad55a4c8777d4d75ec18 Mon Sep 17 00:00:00 2001
From: Markus Reiter <me@reitermark.us>
Date: Mon, 28 Nov 2016 13:56:11 +0100
Subject: [PATCH] Also fail if symlinked artifacts already exist.

---
 Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb
index 69b388425e..2cd172ad3e 100644
--- a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb
+++ b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb
@@ -39,8 +39,7 @@ module Hbc
 
       def preflight_checks(source, target)
         if target.exist? && !self.class.islink?(target)
-          opoo "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking."
-          return false
+          raise CaskError, "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking."
         end
         unless source.exist?
           raise CaskError, "It seems the #{self.class.link_type_english_name.downcase} source is not there: '#{source}'"
-- 
GitLab