From c6a51b992d4aad4c784e6747cb8de522cf25117d Mon Sep 17 00:00:00 2001 From: dlorenc Date: Thu, 9 Jun 2016 15:22:10 -0700 Subject: [PATCH] Minor bugfix in help text test. --- test.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test.sh b/test.sh index 4ecf3b5ab4..337b823bdf 100755 --- a/test.sh +++ b/test.sh @@ -53,11 +53,15 @@ fi # Check that cobra docs are up to date # This is done by generating new docs and then seeing if they are different than the committed docs echo "Checking help documentation..." -go run gen_help_text.go -files=$(git diff) -if [[ $files ]]; then - echo "Help text is out of date: $files \n Please run \"go run gen_help_text.go\"\n and make sure that those doc changes are committed" - exit 1 +if [[ $(git diff) ]]; then + echo "Skipping help text check because the git state is dirty." else - echo "Help text is up to date" + go run gen_help_text.go + files=$(git diff) + if [[ $files ]]; then + echo "Help text is out of date: $files \n Please run \"go run gen_help_text.go\"\n and make sure that those doc changes are committed" + exit 1 + else + echo "Help text is up to date" + fi fi