File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 77# workaround to allow GitHub Desktop to work, add this (hopefully harmless) setting here.
88export PATH=$PATH :/usr/local/bin
99
10+ # Disable output not usually helpful when running in automation (such as guidance to run plan after init)
11+ export TF_IN_AUTOMATION=1
12+
13+ # Store and return last failure from validate so this can validate every directory passed before exiting
14+ VALIDATE_ERROR=0
15+
1016for dir in $( echo " $@ " | xargs -n1 dirname | sort -u | uniq) ; do
17+ echo " --> Running 'terraform validate' in directory '$dir '"
1118 pushd " $dir " > /dev/null
12- terraform init -backend=false
13- terraform validate
19+ terraform init -backend=false || VALIDATE_ERROR= $?
20+ terraform validate || VALIDATE_ERROR= $?
1421 popd > /dev/null
1522done
23+
24+ exit ${VALIDATE_ERROR}
You can’t perform that action at this time.
0 commit comments