Skip to content

Commit

Permalink
fix: regex considering terraform-docs v0.10.0 old
Browse files Browse the repository at this point in the history
Got this error using v1.42.0 on terraform_docs hook:

```sh
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x13fdbe6]
```

Looks like the new `v0.10.0` terraform-docs is going the awk script route instead of "Using terraform-docs 0.8+ (preferred)" route because the regex matches when it shouldn't.
  • Loading branch information
evanstoddard23 authored and Evan Stoddard committed Sep 24, 2020
1 parent 6b03062 commit 61f21ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion terraform_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ terraform_docs_() {
fi

local is_old_terraform_docs
is_old_terraform_docs=$(terraform-docs version | grep -o "v0.[1-7]" | tail -1) || true
is_old_terraform_docs=$(terraform-docs version | grep -o "v0.[1-7]\." | tail -1) || true

if [[ -z "$is_old_terraform_docs" ]]; then # Using terraform-docs 0.8+ (preferred)

Expand Down

0 comments on commit 61f21ed

Please sign in to comment.