fix: typo in arg name for terraform-docs (#283)

This commit is contained in:
Milos Jajac 2021-11-17 19:16:38 +01:00 committed by GitHub
commit feabecc9b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -329,7 +329,7 @@ Unlike most other hooks, this hook triggers once if there are any changed files
- id: terraform_docs - id: terraform_docs
args: args:
- --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc. - --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
- --hook-config=--add-to-exiting-file=true # Boolean. true or false - --hook-config=--add-to-existing-file=true # Boolean. true or false
- --hook-config=--create-file-if-not-exist=true # Boolean. true or false - --hook-config=--create-file-if-not-exist=true # Boolean. true or false
``` ```

View file

@ -119,7 +119,7 @@ terraform_docs() {
# Get hook settings # Get hook settings
# #
local text_file="README.md" local text_file="README.md"
local add_to_exiting=false local add_to_existing=false
local create_if_not_exist=false local create_if_not_exist=false
configs=($hook_config) configs=($hook_config)
@ -132,8 +132,8 @@ terraform_docs() {
--path-to-file) --path-to-file)
text_file=$value text_file=$value
;; ;;
--add-to-exiting-file) --add-to-existing-file)
add_to_exiting=$value add_to_existing=$value
;; ;;
--create-file-if-not-exist) --create-file-if-not-exist)
create_if_not_exist=$value create_if_not_exist=$value
@ -171,10 +171,10 @@ terraform_docs() {
[[ ! -f "$text_file" ]] && popd > /dev/null && continue [[ ! -f "$text_file" ]] && popd > /dev/null && continue
# #
# If `--add-to-exiting-file=true` set, check is in file exist "hook markers", # If `--add-to-existing-file=true` set, check is in file exist "hook markers",
# and if not - append "hook markers" to the end of file. # and if not - append "hook markers" to the end of file.
# #
if $add_to_exiting; then if $add_to_existing; then
HAVE_MARKER=$(grep -o '<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->' "$text_file" || exit 0) HAVE_MARKER=$(grep -o '<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->' "$text_file" || exit 0)
if [ ! "$HAVE_MARKER" ]; then if [ ! "$HAVE_MARKER" ]; then