From fc62748972ed23c3582f4f7cbcc9159816065ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Morais?= Date: Sun, 27 Sep 2020 15:15:23 +0100 Subject: [PATCH] Perform exact word match on brew + grep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: if looking for “git” and there is “git” and “gitish” on the results list, this command will complain. This fix makes sure it matches on the whole word. --- twirl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twirl b/twirl index 651a3b6..d395dac 100755 --- a/twirl +++ b/twirl @@ -480,7 +480,7 @@ ask() { } ############################################################################### -# +# ############################################################################### # return 1 if global command line program installed, else 0 @@ -546,7 +546,7 @@ gem_install_or_update() { } install_brews() { - if test ! $(brew list | grep $brew); then + if test ! $(brew list | grep -x $brew); then echo_install "Installing $brew" brew install $brew >/dev/null print_in_green "${bold}✓ installed!${normal}\n"