From 92e62ba5838f8204e511b7ac77fa3dde47bf92db Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 21 Dec 2017 00:30:06 +0000 Subject: [PATCH 1/2] 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 From cacefb2b99ee760b98100b7cd3664b84fe01e791 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 24 Dec 2017 07:59:17 +0000 Subject: [PATCH 2/2] caveats: tweak root_dir definition style. --- Library/Homebrew/caveats.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index af784a7f2f..ca1c2a9f89 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -86,11 +86,7 @@ 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 + root_dir = f.keg_only? ? f.opt_prefix : HOMEBREW_PREFIX case shell when :bash