Skip to content

Instantly share code, notes, and snippets.

@gibbster
Created June 27, 2018 21:56
Show Gist options
  • Save gibbster/49d9a7123734c37569d0b0b735f625e3 to your computer and use it in GitHub Desktop.
Save gibbster/49d9a7123734c37569d0b0b735f625e3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# .git/hooks/pre-commit
terraform fmt -check=true
if [ $? -eq 0 ]
then
echo "Format looks okay"
exit 0
else
echo "Please format the terraform code first (use terraform fmt)"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment