From 753add2cc75e706edcad9f699a474a5c008a2901 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 3 Jun 2024 13:35:37 +0100 Subject: [PATCH] cmd/setup-ruby: handle empty command path. If this is empty: don't try to `grep` it. --- Library/Homebrew/cmd/setup-ruby.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/setup-ruby.sh b/Library/Homebrew/cmd/setup-ruby.sh index 7c65cf4824..d5ec49ffcb 100644 --- a/Library/Homebrew/cmd/setup-ruby.sh +++ b/Library/Homebrew/cmd/setup-ruby.sh @@ -24,14 +24,15 @@ homebrew-setup-ruby() { source "${HOMEBREW_LIBRARY}/Homebrew/command_path.sh" command_path="$(homebrew-command-path "${command}")" - if [[ -n "${command_path}" && "${command_path}" != *"/dev-cmd/"* ]] + if [[ -n "${command_path}" ]] then - return - fi - - if ! grep -q "Homebrew.install_bundler_gems\!" "${command_path}" - then - return + if [[ "${command_path}" != *"/dev-cmd/"* ]] + then + return + elif ! grep -q "Homebrew.install_bundler_gems\!" "${command_path}" + then + return + fi fi fi