aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2016-09-19 20:16:35 +0100
committerMike McQuaid2016-09-20 10:41:42 +0100
commit0d76dfadcc11a2131917a4a677cc82bc16710b7c (patch)
tree2305619b11c90b9721f48e6efead9b8fbcf8efda /Library/Homebrew
parent205773b885557e3d173dca148f8c29b228ac68c9 (diff)
downloadbrew-0d76dfadcc11a2131917a4a677cc82bc16710b7c.tar.bz2
utils: fix completions/manpages/docs linking.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/utils.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 8121b7146..e466f8a08 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -605,8 +605,11 @@ def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false)
src_paths = link_dir ? [src_dir] : src_dir.find
src_paths.each do |src|
next if src.directory? && !link_dir
- dst = dst_dir.parent/src.relative_path_from(src_dir.parent)
- next if dst.symlink? && src == dst.resolved_path
+ dst = dst_dir/src.relative_path_from(src_dir)
+ if dst.symlink?
+ next if src == dst.resolved_path
+ dst.unlink
+ end
if dst.exist?
conflicts << dst
next