Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -e
- files=$(git diff --cached --name-only)
- for f in $files
- do
- if [ -e "$f" ] && [[ $f == *.tf ]]; then
- #terraform validate `dirname $f`
- terraform fmt $f
- echo -e "\033[032m terraform formatted file: $f \033[0m"
- git add $f
- fi
- done
Add Comment
Please, Sign In to add comment