aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
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/cmd
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/cmd')
-rw-r--r--Library/Homebrew/cmd/list.rb1
-rw-r--r--Library/Homebrew/cmd/tap.rb2
-rw-r--r--Library/Homebrew/cmd/update-report.rb19
3 files changed, 9 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb
index e5c7921b8..790d858aa 100644
--- a/Library/Homebrew/cmd/list.rb
+++ b/Library/Homebrew/cmd/list.rb
@@ -77,6 +77,7 @@ module Homebrew
lib/ruby/site_ruby/[12].*
lib/ruby/vendor_ruby/[12].*
manpages/brew.1
+ manpages/brew-cask.1
share/pypy/*
share/pypy3/*
share/info/dir
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 5b4ed2475..114c4a8b6 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -38,7 +38,7 @@ module Homebrew
def tap
if ARGV.include? "--repair"
- Tap.each(&:link_manpages)
+ Tap.each(&:link_completions_and_manpages)
elsif ARGV.include? "--list-official"
require "official_taps"
puts OFFICIAL_TAPS.map { |t| "homebrew/#{t}" }
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index dcf2891d9..c7c827882 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -104,8 +104,8 @@ module Homebrew
puts if ARGV.include?("--preinstall")
end
- link_completions_and_docs
- Tap.each(&:link_manpages)
+ link_completions_manpages_and_docs
+ Tap.each(&:link_completions_and_manpages)
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]
@@ -281,7 +281,7 @@ module Homebrew
EOS
end
- link_completions_and_docs(new_homebrew_repository)
+ link_completions_manpages_and_docs(new_homebrew_repository)
ohai "Migrated HOMEBREW_REPOSITORY to #{new_homebrew_repository}!"
puts <<-EOS.undent
@@ -302,16 +302,11 @@ module Homebrew
$stderr.puts e.backtrace
end
- def link_completions_and_docs(repository = HOMEBREW_REPOSITORY)
+ def link_completions_manpages_and_docs(repository = HOMEBREW_REPOSITORY)
command = "brew update"
- link_src_dst_dirs(repository/"completions/bash",
- HOMEBREW_PREFIX/"etc/bash_completion.d", command)
- link_src_dst_dirs(repository/"docs",
- HOMEBREW_PREFIX/"share/doc/homebrew", command, link_dir: true)
- link_src_dst_dirs(repository/"completions/zsh",
- HOMEBREW_PREFIX/"share/zsh/site-functions", command)
- link_src_dst_dirs(repository/"manpages",
- HOMEBREW_PREFIX/"share/man/man1", command)
+ Utils::Link.link_completions(repository, command)
+ Utils::Link.link_manpages(repository, command)
+ Utils::Link.link_docs(repository, command)
rescue => e
ofail <<-EOS.undent
Failed to link all completions, docs and manpages: