From c8f256b21df84e18f73c435bfe195f4a13613e2d Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sun, 4 Dec 2022 20:07:31 -0800 Subject: [PATCH] Cleanup `brew prof` - Add exception in brew.rb require check for ruby-prof --- Library/Homebrew/brew.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 4302b65367..9c1d24ceb2 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -7,7 +7,9 @@ if ENV["HOMEBREW_STACKPROF"] end raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] -raise "#{__FILE__} must not be loaded via `require`." if $PROGRAM_NAME != __FILE__ +if $PROGRAM_NAME != __FILE__ && !$PROGRAM_NAME.end_with?("/bin/ruby-prof") + raise "#{__FILE__} must not be loaded via `require`." +end std_trap = trap("INT") { exit! 130 } # no backtrace thanks