From 04a1ecc4f485db9a05c06667be4ae172da713b46 Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Thu, 2 Mar 2017 00:30:16 +0100 Subject: [PATCH] Evaluate glide-hash result without reading $?. validate-glide is called with errexit enabled (in script/make.sh that sources validate-glide), which means that grep returning a non-zero exit code will cause the script to terminate prematurely. Thus, we will never get to the point where we see the error message. The fix is to embed the grep check directly inside the if statement. --- script/validate-glide | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/validate-glide b/script/validate-glide index d5a756c85..e8d2a0988 100755 --- a/script/validate-glide +++ b/script/validate-glide @@ -2,8 +2,7 @@ source "$(dirname "$BASH_SOURCE")/.validate" -grep `glide-hash` glide.lock -if [ $? -eq 0 ]; then +if grep -q "$(glide-hash)" glide.lock; then echo 'Congratulations! glide.lock is unchanged.' else {