aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorJoshua McKinney2016-09-30 18:22:53 -0500
committerJoshua McKinney2017-02-26 15:40:52 -0600
commit25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0 (patch)
treef91be666cdc54f1a69f418a7a54068509105dd23 /Library/Homebrew/tap.rb
parenta74b7ade66e340c55b3bea7b6226fa68a311b4ce (diff)
downloadbrew-25396d9c4d7a7a111eebf02f0ebdbb0e69aad3b0.tar.bz2
Install tap command completions and manpages
Taps can include completion scripts for external commands under `completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap` will automatically install these into the correct directories during install.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb21
1 files changed, 7 insertions, 14 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 4b59f2344..f071904a4 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -236,7 +236,7 @@ class Tap
raise
end
- link_manpages
+ link_completions_and_manpages
formula_count = formula_files.size
puts "Tapped #{formula_count} formula#{plural(formula_count, "e")} (#{path.abv})" unless quiet
@@ -254,8 +254,10 @@ class Tap
EOS
end
- def link_manpages
- link_path_manpages(path, "brew tap --repair")
+ def link_completions_and_manpages
+ command = "brew tap --repair"
+ Utils::Link.link_manpages(path, command)
+ Utils::Link.link_completions(path, command)
end
# uninstall this {Tap}.
@@ -267,23 +269,14 @@ class Tap
unpin if pinned?
formula_count = formula_files.size
Descriptions.uncache_formulae(formula_names)
- unlink_manpages
+ Utils::Link.unlink_manpages(path)
+ Utils::Link.unlink_completions(path)
path.rmtree
path.parent.rmdir_if_possible
puts "Untapped #{formula_count} formula#{plural(formula_count, "e")}"
clear_cache
end
- def unlink_manpages
- return unless (path/"man").exist?
- (path/"man").find do |src|
- next if src.directory?
- dst = HOMEBREW_PREFIX/"share"/src.relative_path_from(path)
- dst.delete if dst.symlink? && src == dst.resolved_path
- dst.parent.rmdir_if_possible
- end
- end
-
# True if the {#remote} of {Tap} is customized.
def custom_remote?
return true unless remote