Modify clean.sh
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
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
This commit is contained in:
44
clean.sh
Executable file
44
clean.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/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!"
|
Reference in New Issue
Block a user