Use resolved_path instead of dirname and readlink directly

This commit is contained in:
Jack Nagel 2014-03-31 22:39:41 -05:00
parent b29be4c9a5
commit d88c79f3cf

View File

@ -218,7 +218,7 @@ class Keg < Pathname
# 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.resolved_path
keg = Keg.for(src) keg = Keg.for(src)
dst.unlink unless mode.dry_run dst.unlink unless mode.dry_run
keg.link_dir(src, mode) { :mkpath } keg.link_dir(src, mode) { :mkpath }