Skip to content
Commits on Source (2)
  • nimrod's avatar
    Terraform 0.15. · eadb49b7
    nimrod authored
    Terraform 0.15 removed the option to specify the directory as an
    argument. Instead it offers a new optional parameter. Instead of dealing
    with different versions in specific ways, just cd to that directory.
    eadb49b7
  • nimrod's avatar
    Bumped patch version. · 17a58514
    nimrod authored
    17a58514
0.1.0
\ No newline at end of file
0.1.2
\ No newline at end of file
......@@ -3,7 +3,10 @@ set -eu
command -v terraform >/dev/null || { echo "Can't find the terraform binary, aborting." >&2; exit 1; }
original_pwd="$PWD"
for i in "$@"
do
terraform fmt "$(dirname "$i")" || true
cd "$(dirname "$i")"
terraform fmt || true
cd "$original_pwd"
done
......@@ -6,10 +6,13 @@ command -v terraform >/dev/null || { echo "Can't find the terraform binary, abor
export TF_INPUT='0'
export TF_IN_AUTOMATION='1'
original_pwd="$PWD"
for i in "$@"
do
terraform init -backend=false "$(dirname "$i")" || { code='1'; continue; }
terraform validate "$(dirname "$i")" || code='1'
cd "$(dirname "$i")"
terraform init -backend=false || { code='1'; continue; }
terraform validate || code='1'
cd "$original_pwd"
done
exit "${code:-0}"