mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
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
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
for file in "$@"; do
|
declare -a paths
|
||||||
terraform fmt "$file"
|
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
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,16 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
for file in "$@"; do
|
declare -a paths
|
||||||
terraform validate -check-variables=false "$file"
|
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
|
done
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,16 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
for file in "$@"; do
|
declare -a paths
|
||||||
terraform validate -check-variables=true "$file"
|
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
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue