schon/scripts/Unix/uninstall.sh
Egor fureunoir Gorbunov 7d1bcaa8d4 Features: 1) Added validation to ensure scripts execute from project root with 'evibes' directory check; 2) Introduced color formatting and ASCII art for enhanced script output; 3) Added RAM, CPU, and disk space verification to installation scripts; 4) Ensured Docker images existence before service startup; 5) Unified spinner-based progress display in Windows and Unix scripts.
Fixes: 1) Replaced hardcoded paths with script-relative paths for better portability; 2) Corrected CPU and memory calculation logic for system checks; 3) Replaced inconsistent script formatting and error handling; 4) Resolved redundant cleanup steps post service startup.

Extra: Refactored and cleaned up script logic for maintainability; added WISELESS branding across scripts for consistency; enhanced terminal output and user messaging.
2025-06-16 15:40:44 +03:00

39 lines
1,009 B
Bash

#!/usr/bin/env bash
set -euo pipefail
if [ ! -d "./evibes" ]; then
printf "\e[31m❌ Please run this script from the project's root (where the 'evibes' directory lives).\e[0m\n"
exit 1
fi
PURPLE="\e[38;2;121;101;209m"
RESET="\e[0m"
GRAY="\e[90m"
CYAN="\e[36m"
RED="\e[31m"
SOURCE="${BASH_SOURCE[0]:-$0}"
SCRIPT_DIR="$(cd "$(dirname "$SOURCE")" && pwd)"
ART_PATH="$SCRIPT_DIR/../ASCII_ART_EVIBES"
if [ ! -f "$ART_PATH" ]; then
printf "%b❌ Could not find ASCII art at %s%b\n" "$RED" "$ART_PATH" "$RESET"
exit 1
fi
while IFS= read -r line; do
printf "%b%s%b\n" "$PURPLE" "$line" "$RESET"
done < "$ART_PATH"
printf "\n%bby WISELESS TEAM%b\n\n" "$GRAY" "$RESET"
printf "%bKilling services…%b\n" "$CYAN" "$RESET"
docker compose down --ansi never
printf "%bCleaning up Docker data…%b\n" "$CYAN" "$RESET"
docker system prune -f
printf "%bRemoving related files…%b\n" "$CYAN" "$RESET"
rm -rf ./services_data ./media ./static
printf "%bBye-bye, hope you return later!%b\n" "$RED" "$RESET"