Minor bugfix in help text test.

pull/193/head
dlorenc 2016-06-09 15:22:10 -07:00
parent 70368f3868
commit c6a51b992d
1 changed files with 10 additions and 6 deletions

16
test.sh
View File

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