Skip to content

Commit 0c0c80e

Browse files
authored
Add support to use args in tflint (#92)
1 parent 5341f38 commit 0c0c80e

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

hooks/tflint.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ export PATH=$PATH:/usr/local/bin
1010
# Install any plugins defined in .tflint.hcl
1111
tflint --init
1212

13-
for file in "$@"; do
14-
tflint $file
13+
14+
declare -a FILES
15+
declare -a ARGS
16+
while [[ $# -gt 0 ]]
17+
do
18+
case "$1" in
19+
-*) ARGS+=("$1")
20+
;;
21+
*) FILES+=("$1")
22+
;;
23+
esac
24+
shift
25+
done
26+
27+
for file in "${FILES[@]}"
28+
do
29+
tflint "${ARGS[@]}" "$file"
1530
done

0 commit comments

Comments
 (0)