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

@ -17,12 +17,12 @@ case ARGV[0]
#TODO check is under +/ with name AND version #TODO check is under +/ with name AND version
#TODO you should mkdirs as you find them and symlink files otherwise #TODO you should mkdirs as you find them and symlink files otherwise
#TODO consider using hardlinks #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 next if from == ARGV[1] #rubysucks
from=Pathname.new from to=$root+from.relative_path_from(target)
to=$root+from.relative_path_from(Pathname.new(ARGV[1]))
if from.directory? if from.directory?
to.mkpath unless to.exist? to.mkpath unless to.exist?