File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed
Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,19 @@ for file_with_path in "$@"; do
88 file_with_path=" ${file_with_path// / __REPLACED__SPACE__} "
99
1010 paths[index]=$( dirname " $file_with_path " )
11- let " index+=1"
11+ (( "index+= 1 " ))
1212done
1313
1414for path_uniq in $( echo " ${paths[*]} " | tr ' ' ' \n' | sort -u) ; do
1515 path_uniq=" ${path_uniq// __REPLACED__SPACE__/ } "
1616
1717 pushd " $path_uniq " > /dev/null
18- terraform validate -check-variables=false
19-
20- if [[ " $? " -ne 0 ]] ; then
21- echo
22- echo " Failed path: $path_uniq "
23- echo " ================================ "
18+ if [[ -n " $( find . -maxdepth 1 -name ' *.tf ' -print -quit ) " ]] ; then
19+ if ! terraform validate -check-variables=false ; then
20+ echo
21+ echo " Failed path: $path_uniq "
22+ echo " ================================ "
23+ fi
2424 fi
2525 popd > /dev/null
2626done
Original file line number Diff line number Diff line change @@ -8,19 +8,19 @@ for file_with_path in "$@"; do
88 file_with_path=" ${file_with_path// / __REPLACED__SPACE__} "
99
1010 paths[index]=$( dirname " $file_with_path " )
11- let " index+=1"
11+ (( "index+= 1 " ))
1212done
1313
1414for path_uniq in $( echo " ${paths[*]} " | tr ' ' ' \n' | sort -u) ; do
1515 path_uniq=" ${path_uniq// __REPLACED__SPACE__/ } "
1616
1717 pushd " $path_uniq " > /dev/null
18- terraform validate -check-variables=true
19-
20- if [[ " $? " -ne 0 ]] ; then
21- echo
22- echo " Failed path: $path_uniq "
23- echo " ================================ "
18+ if [[ -n " $( find . -maxdepth 1 -name ' *.tf ' -print -quit ) " ]] ; then
19+ if ! terraform validate -check-variables=true ; then
20+ echo
21+ echo " Failed path: $path_uniq "
22+ echo " ================================ "
23+ fi
2424 fi
2525 popd > /dev/null
2626done
You can’t perform that action at this time.
0 commit comments