Add summary to scripts/dev/outdated task

This commit is contained in:
Claudio Ortolina
2025-10-25 18:18:07 +01:00
parent 89db253e59
commit f07b7f1ce3
2 changed files with 44 additions and 7 deletions
+2 -1
View File
@@ -30,7 +30,8 @@
"Bash(mise tasks:*)", "Bash(mise tasks:*)",
"Bash(mix run:*)", "Bash(mix run:*)",
"Bash(sqlite3:*)", "Bash(sqlite3:*)",
"WebSearch" "WebSearch",
"Bash(mix shellcheck:*)"
] ]
}, },
"enableAllProjectMcpServers": false "enableAllProjectMcpServers": false
+42 -6
View File
@@ -8,15 +8,51 @@ source "$(git rev-parse --show-toplevel)/scripts/_helpers.sh"
ensure_working_directory! 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)..." debug_msg "Checking outdated tooling (tailwind, esbuild, sqlean)..."
run_and_track "Tailwind" mix tailwind.check_version
# shellcheck disable=SC1010 run_and_track "ESBuild" mix esbuild.check_version
mix do tailwind.check_version + esbuild.check_version + sqlean.check_version run_and_track "Sqlean" mix sqlean.check_version
debug_msg "Checking outdated mix dependencies" 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 "============================================="