cask/artifact/symlinked: do not overwrite files or symbolic links

This commit is contained in:
miccal 2020-08-17 05:36:37 +08:00
parent 96fee494c4
commit 7aaa7f25ec

View File

@ -44,10 +44,10 @@ module Cask
"source '#{source}' is not there."
end
if target.exist? && !target.symlink?
if target.exist?
raise CaskError,
"It seems there is already #{self.class.english_article} " \
"#{self.class.english_name} at '#{target}'; not linking."
"It seems there already exists #{self.class.english_article} " \
"#{self.class.english_name} at '#{target}'; not overwriting."
end
ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'."