Pass the link mode to resolve_any_conflicts
This commit is contained in:
parent
5123f0c802
commit
75af625c17
@ -213,15 +213,15 @@ class Keg < Pathname
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def resolve_any_conflicts dst
|
def resolve_any_conflicts dst, mode
|
||||||
# if it isn't a directory then a severe conflict is about to happen. Let
|
# if it isn't a directory then a severe conflict is about to happen. Let
|
||||||
# it, and the exception that is generated will message to the user about
|
# it, and the exception that is generated will message to the user about
|
||||||
# the situation
|
# the situation
|
||||||
if dst.symlink? and dst.directory?
|
if dst.symlink? and dst.directory?
|
||||||
src = (dst.parent+dst.readlink).cleanpath
|
src = (dst.parent+dst.readlink).cleanpath
|
||||||
keg = Keg.for(src)
|
keg = Keg.for(src)
|
||||||
dst.unlink
|
dst.unlink unless mode.dry_run
|
||||||
keg.link_dir(src) { :mkpath }
|
keg.link_dir(src, mode) { :mkpath }
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
rescue NotAKegError
|
rescue NotAKegError
|
||||||
@ -301,9 +301,9 @@ class Keg < Pathname
|
|||||||
when :skip_dir
|
when :skip_dir
|
||||||
Find.prune
|
Find.prune
|
||||||
when :mkpath
|
when :mkpath
|
||||||
dst.mkpath unless resolve_any_conflicts(dst)
|
dst.mkpath unless resolve_any_conflicts(dst, mode)
|
||||||
else
|
else
|
||||||
unless resolve_any_conflicts(dst)
|
unless resolve_any_conflicts(dst, mode)
|
||||||
make_relative_symlink dst, src, mode
|
make_relative_symlink dst, src, mode
|
||||||
Find.prune
|
Find.prune
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user