cmd/setup-ruby: handle empty command path.

If this is empty: don't try to `grep` it.
This commit is contained in:
Mike McQuaid 2024-06-03 13:35:37 +01:00
parent 78169b4876
commit 753add2cc7
No known key found for this signature in database

View File

@ -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