#!/usr/bin/env bash set -e IMAGE_NAME="karel-simulator" CONTAINER_NAME="karel-simulator" # Stop & remove the container if it exists if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}\$"; then echo "đŸ—‘ī¸ Removing container '${CONTAINER_NAME}'..." docker rm -f "${CONTAINER_NAME}" echo "✅ Container removed." else echo "â„šī¸ No container named '${CONTAINER_NAME}' to remove." fi # Remove the image if it exists if docker images -q "${IMAGE_NAME}" >/dev/null; then echo "đŸ—‘ī¸ Removing image '${IMAGE_NAME}'..." docker rmi "${IMAGE_NAME}" echo "✅ Image removed." else echo "â„šī¸ No image named '${IMAGE_NAME}' to remove." fi