aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 9e1e809db..e94748431 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -79,14 +79,10 @@ class Pathname
end
end
- def install_symlink_p src, new_basename = nil
- if new_basename.nil?
- dst = self+File.basename(src)
- else
- dst = self+File.basename(new_basename)
- end
+ def install_symlink_p src, new_basename=src
+ dst = join File.basename(new_basename)
mkpath
- FileUtils.ln_s src.to_s, dst.to_s
+ FileUtils.ln_s Pathname(src).relative_path_from(dst.parent), dst
end
protected :install_symlink_p