Use relative and not absolute symlinks

This refers to the 'brew ln' command
This commit is contained in:
Max Howell 2009-05-21 01:21:20 +01:00
parent 8d8ac4b657
commit d5241043f3

View File

@ -22,13 +22,13 @@ case ARGV[0]
next if from == ARGV[1] #rubysucks
from=Pathname.new from
relto=from.relative_path_from(Pathname.new(ARGV[1]))
to=$root+relto;
to=$root+from.relative_path_from(Pathname.new(ARGV[1]))
if from.directory?
to.mkpath unless to.exist? and relto.to_s.include? '/'
to.mkpath unless to.exist?
elsif from.file?
to.make_symlink from
tod=to.dirname
Dir.chdir(tod) { `ln -s #{from.relative_path_from tod}` }
end
end