From edd9a9717cf08eabb54001679653e37732d5ce2d Mon Sep 17 00:00:00 2001 From: Eugene Nikolsky Date: Sat, 1 Apr 2017 19:00:24 -0700 Subject: Fix the 'export PATH' message in `link` for a keg-only formula Commit 4cae6a724e6d684eb157dd6d7328755694f228b2 introduced the message, but it printed the wrong path, e.g. for `brew link sqlite`: ``` If you need to have this software first in your PATH instead consider running: echo 'export PATH="/usr/local/opt/sqlite:$PATH"' >> ~/.zshrc/bin ``` where `/bin` is appended at the end, but should be inserted before `:$PATH`: `echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc`. This patch fixes that and updates a test to verify it. --- Library/Homebrew/cmd/link.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 293f09eef..a1d1397da 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -86,8 +86,8 @@ module Homebrew opt = HOMEBREW_PREFIX/"opt/#{keg.name}" puts "\nIf you need to have this software first in your PATH instead consider running:" - puts " #{Utils::Shell.prepend_path_in_shell_profile(opt)}/bin" if bin.directory? - puts " #{Utils::Shell.prepend_path_in_shell_profile(opt)}/sbin" if sbin.directory? + puts " #{Utils::Shell.prepend_path_in_shell_profile(opt/"bin")}" if bin.directory? + puts " #{Utils::Shell.prepend_path_in_shell_profile(opt/"sbin")}" if sbin.directory? end def keg_only?(rack) -- cgit v1.2.3