#!/usr/bin/env bash set -Eeuo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$SCRIPT_DIR" COMPOSE_FILE="$PROJECT_DIR/docker-compose.yml" ENV_FILE="$PROJECT_DIR/.env" FORCE=0 if [[ "${1:-}" == "--force" ]]; then FORCE=1 fi if [[ $FORCE -eq 0 ]]; then echo "WARNING: This will remove the Flutter portal containers, local images, and volumes for this project." read -r -p "Continue? [y/N]: " answer if [[ ! "$answer" =~ ^[Yy]$ ]]; then echo "Uninstall cancelled." exit 0 fi fi if [[ -f "$COMPOSE_FILE" ]]; then if [[ -f "$ENV_FILE" ]]; then docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" down --remove-orphans --volumes --rmi local || true else docker compose -f "$COMPOSE_FILE" down --remove-orphans --volumes --rmi local || true fi fi docker container rm -f flutter_ecommerce_portal_web >/dev/null 2>&1 || true echo "Cleanup complete for flutter_ecommerce_portal."