Fail if cask source already exists.
This commit is contained in:
parent
3bcf80f651
commit
9a29bd35e6
@ -45,8 +45,7 @@ module Hbc
|
|||||||
if force
|
if force
|
||||||
ohai(warning_target_exists { |s| s << "overwriting." })
|
ohai(warning_target_exists { |s| s << "overwriting." })
|
||||||
else
|
else
|
||||||
ohai(warning_target_exists { |s| s << "not moving." })
|
raise CaskError, warning_target_exists << "."
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless source.exist?
|
unless source.exist?
|
||||||
|
|||||||
@ -39,7 +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)
|
||||||
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
|
return false
|
||||||
end
|
end
|
||||||
unless source.exist?
|
unless source.exist?
|
||||||
|
|||||||
@ -35,6 +35,8 @@ module Hbc
|
|||||||
rescue CaskNoShasumError => e
|
rescue CaskNoShasumError => e
|
||||||
opoo e.message
|
opoo e.message
|
||||||
count += 1
|
count += 1
|
||||||
|
rescue CaskError => e
|
||||||
|
onoe e.message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
count.zero? ? nil : count == cask_tokens.length
|
count.zero? ? nil : count == cask_tokens.length
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user