From 79bc3f477447335e180b5ae809caa0561c706948 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 20 Feb 2015 14:02:43 -0500 Subject: [PATCH] Fix test for existence of go-nyet. When the file is not found, `which` returns an empty string, which passes the -f test. `command -v` is the most portable alternative to `which` per http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212 --- test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test b/test index 4c8d09cae..369b750d0 100755 --- a/test +++ b/test @@ -60,7 +60,7 @@ if [ -n "${vetRes}" ]; then exit 255 fi -if [ -f `which go-nyet` ]; then +if command -v go-nyet >/dev/null 2>&1; then echo "Checking go-nyet..." nyetRes=$(go-nyet -exitWith 0 $FMT) if [ -n "${nyetRes}" ]; then