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 7
7
# workaround to allow GitHub Desktop to work, add this (hopefully harmless) setting here.
8
8
export PATH=$PATH :/usr/local/bin
9
9
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
+
10
16
for dir in $( echo " $@ " | xargs -n1 dirname | sort -u | uniq) ; do
17
+ echo " --> Running 'terraform validate' in directory '$dir '"
11
18
pushd " $dir " > /dev/null
12
- terraform init -backend=false
13
- terraform validate
19
+ terraform init -backend=false || VALIDATE_ERROR= $?
20
+ terraform validate || VALIDATE_ERROR= $?
14
21
popd > /dev/null
15
22
done
23
+
24
+ exit ${VALIDATE_ERROR}
You can’t perform that action at this time.
0 commit comments