Skip to content

Commit 23543d9

Browse files
committed
Fix terraform fmt hook where it is now running on all files regardless of exclude
1 parent f6d9d62 commit 23543d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hooks/terraform-fmt.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ set -e
77
# workaround to allow GitHub Desktop to work, add this (hopefully harmless) setting here.
88
export PATH=$PATH:/usr/local/bin
99

10-
terraform fmt -recursive
10+
for file in "$@"; do
11+
tmp_file="$(mktemp)"
12+
terraform fmt - <"$file" >"$tmp_file"
13+
mv "$tmp_file" "$file"
14+
done

0 commit comments

Comments
 (0)