Also fail if symlinked artifacts already exist.

This commit is contained in:
Markus Reiter 2016-11-28 13:56:11 +01:00
parent e63efb3fe4
commit e0b93f1537

View File

@ -39,8 +39,7 @@ module Hbc
def preflight_checks(source, target) def preflight_checks(source, target)
if target.exist? && !self.class.islink?(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." raise CaskError, "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking."
return false
end end
unless source.exist? unless source.exist?
raise CaskError, "It seems the #{self.class.link_type_english_name.downcase} source is not there: '#{source}'" raise CaskError, "It seems the #{self.class.link_type_english_name.downcase} source is not there: '#{source}'"