This commit is contained in:
Claudio Ortolina
2026-03-08 08:51:54 +00:00
parent e4d03a19e4
commit fd9f3e7c0c
+17 -13
View File
@@ -11,36 +11,39 @@ ensure_working_directory!
# Initialize arrays to track commands # Initialize arrays to track commands
declare -a command_names declare -a command_names
declare -a command_results declare -a command_results
declare -a command_next_steps
# Function to run and track commands # Function to run and track commands
run_and_track() { run_and_track() {
local name="$1" local name="$1"
shift local next_step="$2"
shift 2
"$@" "$@"
local result=$? local result=$?
command_names+=("$name") command_names+=("$name")
command_results+=("$result") command_results+=("$result")
command_next_steps+=("$next_step")
return $result return $result
} }
debug_msg "Checking outdated NPM dependencies..." debug_msg "Checking outdated NPM dependencies..."
run_and_track "NPM dependencies" npm outdated --prefix assets run_and_track "NPM dependencies" "npm update --prefix assets" 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 run_and_track "Tailwind" "mix tailwind.update_version" mix tailwind.check_version
run_and_track "ESBuild" mix esbuild.check_version run_and_track "ESBuild" "mix esbuild.update_version" mix esbuild.check_version
run_and_track "Sqlean" mix sqlean.check_version run_and_track "Sqlean" "mix sqlean.update_version" 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 run_and_track "Mix dependencies" "mix deps.update --all" mix hex.outdated --all
# Print summary table # Print summary table
echo "" echo ""
echo "=============================================" echo "========================================================================"
echo "Summary" echo "Summary"
echo "=============================================" echo "========================================================================"
printf "%-30s | %s\n" "Dependency" "Status" printf "%-20s | %-16s | %s\n" "Dependency" "Status" "Next Step"
echo "---------------------------------------------" echo "------------------------------------------------------------------------"
red=$(tput setaf 1) red=$(tput setaf 1)
green=$(tput setaf 2) green=$(tput setaf 2)
@@ -49,12 +52,13 @@ normal=$(tput sgr0)
for i in "${!command_names[@]}"; do for i in "${!command_names[@]}"; do
name="${command_names[$i]}" name="${command_names[$i]}"
result="${command_results[$i]}" result="${command_results[$i]}"
next_step="${command_next_steps[$i]}"
if [ "$result" -eq 0 ]; then if [ "$result" -eq 0 ]; then
printf "%-30s | %s\n" "$name" "${green}✓ Up to date${normal}" printf "%-20s | %s%-16s%s | %s\n" "$name" "$green" "✓ Up to date" "$normal" ""
else else
printf "%-30s | %s\n" "$name" "${red}✗ Outdated${normal}" printf "%-20s | %s%-16s%s | %s\n" "$name" "$red" "✗ Outdated" "$normal" "$next_step"
fi fi
done done
echo "=============================================" echo "========================================================================"