Guest User

Untitled

a guest
Mar 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. set -e
  4.  
  5. files=$(git diff --cached --name-only)
  6. for f in $files
  7. do
  8. if [ -e "$f" ] && [[ $f == *.tf ]]; then
  9. #terraform validate `dirname $f`
  10. terraform fmt $f
  11. echo -e "\033[032m terraform formatted file: $f \033[0m"
  12. git add $f
  13. fi
  14. done
Add Comment
Please, Sign In to add comment