Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion hooks/terragrunt-hcl-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ export PATH=$PATH:/usr/local/bin
check_terragrunt_version() {
local minimum_supported_version="0.77.22"
local current_version
local version_output

if ! command -v terragrunt >/dev/null 2>&1; then
echo "Warning: terragrunt command not found. Proceeding anyway..." >&2

return 0
fi

if ! current_version=$(terragrunt --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1); then
version_output=$(terragrunt --version 2>/dev/null)

if [[ "$version_output" == *"latest"* ]]; then
return 0
fi

if ! current_version=$(echo "$version_output" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1); then
echo "Warning: Could not determine terragrunt version. Proceeding anyway..." >&2

return 0
Expand Down