forked from github/pre-commit-opentofu
Updated scripts
This commit is contained in:
parent
5f3ac96d44
commit
e220e169ca
3 changed files with 39 additions and 6 deletions
|
|
@ -1,5 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
for file in "$@"; do
|
||||
terraform fmt "$file"
|
||||
declare -a paths
|
||||
index=0
|
||||
|
||||
for file_with_path in "$@"; do
|
||||
paths[index]=$(dirname "$file_with_path")
|
||||
let "index+=1"
|
||||
done
|
||||
|
||||
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
|
||||
pushd "$path_uniq" > /dev/null
|
||||
terraform fmt
|
||||
popd > /dev/null
|
||||
done
|
||||
|
|
|
|||
|
|
@ -1,5 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
for file in "$@"; do
|
||||
terraform validate -check-variables=false "$file"
|
||||
declare -a paths
|
||||
index=0
|
||||
|
||||
for file_with_path in "$@"; do
|
||||
paths[index]=$(dirname "$file_with_path")
|
||||
let "index+=1"
|
||||
done
|
||||
|
||||
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
|
||||
pushd "$path_uniq" > /dev/null
|
||||
terraform validate -check-variables=false
|
||||
popd > /dev/null
|
||||
done
|
||||
|
|
|
|||
|
|
@ -1,5 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
for file in "$@"; do
|
||||
terraform validate -check-variables=true "$file"
|
||||
declare -a paths
|
||||
index=0
|
||||
|
||||
for file_with_path in "$@"; do
|
||||
paths[index]=$(dirname "$file_with_path")
|
||||
let "index+=1"
|
||||
done
|
||||
|
||||
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
|
||||
pushd "$path_uniq" > /dev/null
|
||||
terraform validate -check-variables=true
|
||||
popd > /dev/null
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue