Skip to content
Snippets Groups Projects
Commit 9a29bd35 authored by Markus Reiter's avatar Markus Reiter
Browse files

Fail if cask source already exists.

parent 3bcf80f6
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,7 @@ module Hbc
if force
ohai(warning_target_exists { |s| s << "overwriting." })
else
ohai(warning_target_exists { |s| s << "not moving." })
return false
raise CaskError, warning_target_exists << "."
end
end
unless source.exist?
......
......@@ -39,7 +39,7 @@ module Hbc
def preflight_checks(source, target)
if target.exist? && !self.class.islink?(target)
ohai "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking."
opoo "It seems there is already #{self.class.artifact_english_article} #{self.class.artifact_english_name} at '#{target}'; not linking."
return false
end
unless source.exist?
......
......@@ -35,6 +35,8 @@ module Hbc
rescue CaskNoShasumError => e
opoo e.message
count += 1
rescue CaskError => e
onoe e.message
end
end
count.zero? ? nil : count == cask_tokens.length
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment