mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
chore: Add shellcheck and make checks passing (#315)
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
This commit is contained in:
parent
645f3fd126
commit
3045dd55a3
5 changed files with 34 additions and 24 deletions
|
|
@ -121,9 +121,11 @@ function terraform_docs {
|
|||
local add_to_existing=false
|
||||
local create_if_not_exist=false
|
||||
|
||||
configs=($hook_config)
|
||||
read -r -a configs <<< "$hook_config"
|
||||
|
||||
for c in "${configs[@]}"; do
|
||||
config=(${c//=/ })
|
||||
|
||||
IFS="=" read -r -a config <<< "$c"
|
||||
key=${config[0]}
|
||||
value=${config[1]}
|
||||
|
||||
|
|
@ -161,9 +163,11 @@ function terraform_docs {
|
|||
dir="$(dirname "$text_file")"
|
||||
|
||||
mkdir -p "$dir"
|
||||
echo -e "# ${PWD##*/}\n" >> "$text_file"
|
||||
echo "<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->" >> "$text_file"
|
||||
echo "<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->" >> "$text_file"
|
||||
{
|
||||
echo -e "# ${PWD##*/}\n"
|
||||
echo "<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->"
|
||||
echo "<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->"
|
||||
} >> "$text_file"
|
||||
fi
|
||||
|
||||
# If file still not exist - skip dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue