Skip to content

Commit 086b2ad

Browse files
committed
refactor: Reuse logic from common functions
From @MaxymVlasov in antonbabenko#401 (comment): > Heh, you found code written in Paleolithic. > > Let's try reuse logic that used in common functions here: > > https://github.com/antonbabenko/pre-commit-terraform/blob/master/hooks/_common.sh#L178 > > Absolutely have no idea why it was written in so complex way
1 parent 57467c5 commit 086b2ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hooks/terraform_validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function terraform_validate_ {
111111

112112
if [[ -n "$(find "$dir_path" -maxdepth 1 -name '*.tf' -print -quit)" ]]; then
113113

114-
pushd "$(cd "$dir_path" > /dev/null && pwd -P)" > /dev/null
114+
pushd "$dir_path" > /dev/null || continue
115115

116116
if [ ! -d .terraform ]; then
117117
set +e

0 commit comments

Comments
 (0)