Files
getpkg/clean.sh
Your Name 9a24576e37
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m28s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m28s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
Modify clean.sh
2025-06-29 20:31:18 +12:00

44 lines
981 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "🧹 CLEANING ALL PROJECTS 🧹"
echo
# Get all project directories
PROJECT_DIRS=$(find "$SCRIPT_DIR" -maxdepth 1 -type d \
-not -name ".*" \
-not -path "$SCRIPT_DIR" | sort)
for dir in $PROJECT_DIRS; do
PROJECT_NAME=$(basename "$dir")
if [ -f "$dir/clean.sh" ]; then
echo "Cleaning $PROJECT_NAME..."
cd "$dir"
./clean.sh
echo
else
echo "⚠️ No clean.sh found for $PROJECT_NAME, skipping..."
echo
fi
done
# Global Docker cleanup
echo "🐳 Global Docker cleanup..."
echo "Removing unused Docker images..."
docker image prune -f
echo "Removing unused Docker containers..."
docker container prune -f
echo "Removing unused Docker networks..."
docker network prune -f
echo "Removing unused Docker volumes..."
docker volume prune -f
echo
echo "✅ All projects cleaned successfully!"