diff options
| author | Mike McQuaid | 2017-02-27 08:42:17 +0000 |
|---|---|---|
| committer | GitHub | 2017-02-27 08:42:17 +0000 |
| commit | 0a8c8f90b68b9b2dddcf7284c9c1f941aebb1277 (patch) | |
| tree | 126f61113b502b7e39e75d1d9c7f9c33f48af793 /Library/Homebrew/utils.rb | |
| parent | ef85460c52ddea6234bf7964ae5a2e4bd4f11bce (diff) | |
| parent | 25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0 (diff) | |
| download | brew-0a8c8f90b68b9b2dddcf7284c9c1f941aebb1277.tar.bz2 | |
Merge pull request #1708 from joshka/feature/install-tap-cmd-completions
install tap cmd completions
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 56ddfd611..0e3c0f568 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -9,6 +9,7 @@ require "utils/git" require "utils/github" require "utils/hash" require "utils/inreplace" +require "utils/link" require "utils/popen" require "utils/svn" require "utils/tty" @@ -482,38 +483,6 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {}) out end -def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) - return unless src_dir.exist? - conflicts = [] - src_paths = link_dir ? [src_dir] : src_dir.find - src_paths.each do |src| - next if src.directory? && !link_dir - 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 - end - dst_dir.parent.mkpath - dst.make_relative_symlink(src) - end - - return if conflicts.empty? - onoe <<-EOS.undent - Could not link: - #{conflicts.join("\n")} - - Please delete these paths and run `#{command}`. - EOS -end - -def link_path_manpages(path, command) - link_src_dst_dirs(path/"man", HOMEBREW_PREFIX/"share/man", command) -end - def migrate_legacy_keg_symlinks_if_necessary legacy_linked_kegs = HOMEBREW_LIBRARY/"LinkedKegs" return unless legacy_linked_kegs.directory? |
