From f07b7f1ce3517b9b6f53425e766654f3f3559163 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 25 Oct 2025 18:18:07 +0100 Subject: [PATCH] Add summary to scripts/dev/outdated task --- .claude/settings.local.json | 3 ++- scripts/dev/outdated | 48 ++++++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 51dfd1ee..5c62281b 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -30,7 +30,8 @@ "Bash(mise tasks:*)", "Bash(mix run:*)", "Bash(sqlite3:*)", - "WebSearch" + "WebSearch", + "Bash(mix shellcheck:*)" ] }, "enableAllProjectMcpServers": false diff --git a/scripts/dev/outdated b/scripts/dev/outdated index 9d9a985e..6eefc434 100755 --- a/scripts/dev/outdated +++ b/scripts/dev/outdated @@ -8,15 +8,51 @@ source "$(git rev-parse --show-toplevel)/scripts/_helpers.sh" ensure_working_directory! -debug_msg "Checking outdated NPM dependencies..." +# Initialize arrays to track commands +declare -a command_names +declare -a command_results -npm outdated --prefix assets +# Function to run and track commands +run_and_track() { + local name="$1" + shift + "$@" + local result=$? + command_names+=("$name") + command_results+=("$result") + return $result +} + +debug_msg "Checking outdated NPM dependencies..." +run_and_track "NPM dependencies" npm outdated --prefix assets debug_msg "Checking outdated tooling (tailwind, esbuild, sqlean)..." - -# shellcheck disable=SC1010 -mix do tailwind.check_version + esbuild.check_version + sqlean.check_version +run_and_track "Tailwind" mix tailwind.check_version +run_and_track "ESBuild" mix esbuild.check_version +run_and_track "Sqlean" mix sqlean.check_version debug_msg "Checking outdated mix dependencies" +run_and_track "Mix dependencies" mix hex.outdated --all -mix hex.outdated --all +# Print summary table +echo "" +echo "=============================================" +echo "Summary" +echo "=============================================" +printf "%-30s | %s\n" "Dependency" "Status" +echo "---------------------------------------------" + +for i in "${!command_names[@]}"; do + name="${command_names[$i]}" + result="${command_results[$i]}" + + if [ "$result" -eq 0 ]; then + status="✓ Up to date" + else + status="✗ Run update" + fi + + printf "%-30s | %s\n" "$name" "$status" +done + +echo "============================================="