brew ln works with relative paths

This commit is contained in:
Max Howell 2009-05-21 02:46:18 +01:00
parent bab81f6d00
commit 86df92e94f

View File

@ -18,11 +18,11 @@ case ARGV[0]
#TODO you should mkdirs as you find them and symlink files otherwise
#TODO consider using hardlinks
Find.find ARGV[1] do |from|
target=Pathname.new(ARGV[1]).realpath
target.find do |from|
next if from == ARGV[1] #rubysucks
from=Pathname.new from
to=$root+from.relative_path_from(Pathname.new(ARGV[1]))
to=$root+from.relative_path_from(target)
if from.directory?
to.mkpath unless to.exist?