Added shfmt to autoformat shell scripts (#86)

This commit is contained in:
Anton Babenko 2020-01-21 11:54:13 +01:00 committed by GitHub
commit 1e5b3af0d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 269 additions and 209 deletions

View file

@ -9,13 +9,13 @@ for file_with_path in "$@"; do
file_with_path="${file_with_path// /__REPLACED__SPACE__}"
paths[index]=$(dirname "$file_with_path")
(( "index+=1" ))
(("index+=1"))
done
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
path_uniq="${path_uniq//__REPLACED__SPACE__/ }"
if [[ -n "$(find . -maxdepth 1 -name '*.tf' -print -quit)" ]] ; then
if [[ -n "$(find . -maxdepth 1 -name '*.tf' -print -quit)" ]]; then
if ! terraform validate $path_uniq; then
error=1
echo
@ -25,6 +25,6 @@ for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
fi
done
if [[ "${error}" -ne 0 ]] ; then
if [[ "${error}" -ne 0 ]]; then
exit 1
fi