Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reavon/c9b82ffc72cb92b085ade0ca8a343fd6 to your computer and use it in GitHub Desktop.
Save reavon/c9b82ffc72cb92b085ade0ca8a343fd6 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