Skip to content

Commit 93029dc

Browse files
authored
fix(terraform_tflint): Restore current working directory behavior (antonbabenko#302)
1 parent 59da4b8 commit 93029dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

terraform_tflint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,20 @@ tflint_() {
6262
tflint_final_exit_code=0
6363
for path_uniq in $(echo "${paths[*]}" | tr ' ' '\n' | sort -u); do
6464
path_uniq="${path_uniq//__REPLACED__SPACE__/ }"
65+
pushd "$path_uniq" > /dev/null
6566

6667
# Print checked PATH **only** if TFLint have any messages
6768
# shellcheck disable=SC2091 # Suppress error output
68-
$(tflint "${ARGS[@]}" $path_uniq 2>&1) 2> /dev/null || {
69+
$(tflint "${ARGS[@]}" 2>&1) 2> /dev/null || {
6970
echo >&2 -e "\033[1;33m\nTFLint in $path_uniq/:\033[0m"
70-
tflint "${ARGS[@]}" $path_uniq
71+
tflint "${ARGS[@]}"
7172
}
7273
local exit_code=$?
7374
if [ $exit_code != 0 ]; then
7475
tflint_final_exit_code=$exit_code
7576
fi
77+
78+
popd > /dev/null
7679
done
7780
set -e
7881
exit $tflint_final_exit_code

0 commit comments

Comments
 (0)