Skip to content

Commit

Permalink
verify-generated-docs: Use exit code rather than comparison to empty …
Browse files Browse the repository at this point in the history
…string

Checking the exit code rather than the empty string has the advantage
that you can identify what was found (comparison consumes the string, so
it's not printed). It makes debugging much easier when something is wrong.
  • Loading branch information
Antoine Pelisse committed Jul 12, 2018
1 parent df1d9b9 commit fe0aa25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hack/verify-generated-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kube::util::ensure-temp-dir
kube::util::gen-docs "${KUBE_TEMP}"

# Verify the list matches the expected list (diff should be empty)
if [[ "$(diff ${KUBE_ROOT}/docs/.generated_docs ${KUBE_TEMP}/docs/.generated_docs)" != "" ]]; then
if ! diff "${KUBE_ROOT}/docs/.generated_docs" "${KUBE_TEMP}/docs/.generated_docs"; then
echo "List of generated docs doesn't match a freshly built list. Please run hack/update-generated-docs.sh"
exit 1
fi
Expand Down

0 comments on commit fe0aa25

Please sign in to comment.