diff --git a/hooks/terraform_docs.sh b/hooks/terraform_docs.sh index 72979dc55..3d0cc884a 100755 --- a/hooks/terraform_docs.sh +++ b/hooks/terraform_docs.sh @@ -93,7 +93,10 @@ function terraform_docs { for c in "${configs[@]}"; do IFS="=" read -r -a config <<< "$c" - key=${config[0]} + # $hook_config receives string like '--foo=bar; --baz=4;' etc. + # It gets split by `;` into array, which we're parsing here ('--foo=bar' ' --baz=4') + # Next line removes leading spaces, to support >1 `--hook-config` args + key="${config[0]## }" value=${config[1]} case $key in