This commit is contained in:
21
scripts/format.sh
Executable file
21
scripts/format.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
for DIR in $(find . -type d); do
|
||||
|
||||
if [[ "${DIR}" = "." ]] || [[ $(echo ${DIR} | cut -c1-5) = ".git/" ]]; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
pushd $DIR
|
||||
terraform_files=$(find . -maxdepth 1 -type f -iname '*.tf')
|
||||
if [[ ${#terraform_files} -eq 0 ]]; then
|
||||
popd
|
||||
continue
|
||||
fi
|
||||
|
||||
terraform fmt
|
||||
|
||||
popd
|
||||
done
|
||||
Reference in New Issue
Block a user