aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominyk Tiller2017-12-21 00:30:06 +0000
committerDominyk Tiller2017-12-23 23:15:59 +0000
commit92e62ba5838f8204e511b7ac77fa3dde47bf92db (patch)
tree98a5d9e83732b56370f8a671dec65343726bdacf
parent898981f17b21bd8caee820d8caaf6dca1e1e6c13 (diff)
downloadbrew-92e62ba5838f8204e511b7ac77fa3dde47bf92db.tar.bz2
caveats: correct completion/function paths for keg_only
-rw-r--r--Library/Homebrew/caveats.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index aad354607..af784a7f2 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -86,21 +86,27 @@ class Caveats
installed << "completions" if completion_installed
installed << "functions" if functions_installed
+ if f.keg_only?
+ root_dir = f.opt_prefix
+ else
+ root_dir = HOMEBREW_PREFIX
+ end
+
case shell
when :bash
<<~EOS
Bash completion has been installed to:
- #{HOMEBREW_PREFIX}/etc/bash_completion.d
+ #{root_dir}/etc/bash_completion.d
EOS
when :zsh
<<~EOS
zsh #{installed.join(" and ")} have been installed to:
- #{HOMEBREW_PREFIX}/share/zsh/site-functions
+ #{root_dir}/share/zsh/site-functions
EOS
when :fish
fish_caveats = "fish #{installed.join(" and ")} have been installed to:"
- fish_caveats << "\n #{HOMEBREW_PREFIX}/share/fish/vendor_completions.d" if completion_installed
- fish_caveats << "\n #{HOMEBREW_PREFIX}/share/fish/vendor_functions.d" if functions_installed
+ fish_caveats << "\n #{root_dir}/share/fish/vendor_completions.d" if completion_installed
+ fish_caveats << "\n #{root_dir}/share/fish/vendor_functions.d" if functions_installed
fish_caveats
end
end