Skip to content
Snippets Groups Projects
Commit d5241043 authored by Max Howell's avatar Max Howell
Browse files

Use relative and not absolute symlinks

This refers to the 'brew ln' command
parent 8d8ac4b6
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment