Skip to content

Commit cb6a120

Browse files
MaxymVlasovCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 2601455 commit cb6a120

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

hooks/terraform_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ function terraform_docs {
207207
#
208208
if $create_if_not_exist && [[ ! -f "$output_file" ]]; then
209209
dir_have_tf_files="$(
210-
find . -maxdepth 1 -type f | sed 's|.*\.||' | sort -u | grep -oE '^tf$|^tofu$|^tfvars$' ||
210+
find . -maxdepth 1 \( -name '*.tf' -o -name '*.tofu' -o -name '*.tfvars' \) ||
211211
exit 0
212212
)"
213213

hooks/terraform_wrapper_module_for_each.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ EOF
312312

313313
# Read content of all terraform files
314314
# shellcheck disable=SC2207
315-
all_tf_content=$(find "${full_module_dir}" -regex '.*\.(tf|tofu)' -maxdepth 1 -type f -exec cat {} +)
315+
all_tf_content=$(find "${full_module_dir}" \( -name '*.tf' -o -name '*.tofu' \) -maxdepth 1 -type f -exec cat {} +)
316316

317317
if [[ ! $all_tf_content ]]; then
318318
common::colorify "yellow" "Skipping ${full_module_dir} because there are no .tf or .tofu files."

0 commit comments

Comments
 (0)