diff options
| author | Jack Nagel | 2015-03-24 21:05:34 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-03-24 21:06:19 -0400 |
| commit | ab3d622da231b862a363e56cfcce63e5d2ea1f4c (patch) | |
| tree | a493f4c74ca2a44fd3649c41494355a73dc72af3 /Library/Homebrew/extend/pathname.rb | |
| parent | 6f0efd6f3dcb810f5f14770effd52ea07e1fdffe (diff) | |
| download | brew-ab3d622da231b862a363e56cfcce63e5d2ea1f4c.tar.bz2 | |
Always pass basename to install_symlink_p
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 17b11eb87..86c4f8a24 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -64,20 +64,20 @@ class Pathname sources.each do |src| case src when Array - src.each {|s| install_symlink_p(s) } + src.each { |s| install_symlink_p(s, File.basename(s)) } when Hash - src.each {|s, new_basename| install_symlink_p(s, new_basename) } + src.each { |s, new_basename| install_symlink_p(s, new_basename) } else - install_symlink_p(src) + install_symlink_p(src, File.basename(src)) end end end - def install_symlink_p src, new_basename=src + def install_symlink_p(src, new_basename) src = Pathname(src).expand_path(self) - dst = join File.basename(new_basename) + dst = join(new_basename) mkpath - FileUtils.ln_sf src.relative_path_from(dst.parent), dst + FileUtils.ln_sf(src.relative_path_from(dst.parent), dst) end protected :install_symlink_p |
