aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorJack Nagel2014-03-18 19:03:25 -0500
committerJack Nagel2014-03-18 19:03:25 -0500
commitaa7ed10968508f0390fba88c3bb2f2b0e8db9415 (patch)
tree189f35ae1d1df8924a6c8c5083e5e3fca4d2ff2d /Library/Homebrew/extend
parent4353f4fc97b53f606c0dd3b37a9c678f7db561ee (diff)
downloadbrew-aa7ed10968508f0390fba88c3bb2f2b0e8db9415.tar.bz2
Make relative symlinks in Pathname#install_symlink
Closes Homebrew/homebrew#27672.
Diffstat (limited to 'Library/Homebrew/extend')
-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