1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env bash set -Eeuo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" cd ../ terraform fmt -check=true -diff=true || { echo "Terraform files are unformatted. To fix it, run:" echo " terraform fmt" exit 1 }