Skip to content

Commit

Permalink
Feedback from @MaxymVlasov
Browse files Browse the repository at this point in the history
  • Loading branch information
jrottenberg committed Feb 22, 2022
1 parent 2dd8fcb commit 456610b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@
require_serial: true
files: \.tf$
pass_filenames: false
args: ["terraform"]
args: ["--args=terraform"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ Out of the box tfupdate will pin the terraform version
- id: tfupdate
name: tfupdate provider vsphere
args:
- provider
- vsphere
- --args=provider
- --args=vsphere
```
See the `tfupdate --help` command line help for available options. No need to pass `--recursive .` as it is added automatically

Expand Down
8 changes: 6 additions & 2 deletions hooks/tfupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ source "$SCRIPT_DIR/_common.sh"

function main {
common::initialize "$SCRIPT_DIR"
tfupdate_ "$@"
common::parse_cmdline "$@"
# shellcheck disable=SC2153 # False positive

tfupdate_ "${ARGS[*]}"

}

#######################################################################
# tfupdate_
#######################################################################
function tfupdate_ {
local -r args=$*
local -r args="$1"
# pass the arguments to hook
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting.
tfupdate ${args} --recursive .
Expand Down

0 comments on commit 456610b

Please sign in to comment.