Skip to content

Instantly share code, notes, and snippets.

@surminus
Created April 19, 2018 12:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save surminus/1bf3b02381f74569446216021ac0d713 to your computer and use it in GitHub Desktop.
Save surminus/1bf3b02381f74569446216021ac0d713 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -eu
for file in "$@"; do
failed=0
dir=$(dirname ${file})
if ! cmp -s <(terraform-docs md ${dir}) "${dir}/README.md"; then
echo "Need to update Terraform docs for: "
echo "${dir}"
echo "Run: terraform-docs md ${dir} > ${dir}/README.md"
failed=1
fi
if [ $failed -eq 1 ]; then
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment