Fail if cask source already exists.
This commit is contained in:
parent
3bcf80f651
commit
9a29bd35e6
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user