From 92e62ba5838f8204e511b7ac77fa3dde47bf92db Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 21 Dec 2017 00:30:06 +0000 Subject: [PATCH] caveats: correct completion/function paths for keg_only --- Library/Homebrew/caveats.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index aad3546071..af784a7f2f 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