#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT="sos"

echo "Cleaning ${PROJECT}..."

# Remove output directory (if it exists)
if [ -d "${SCRIPT_DIR}/output" ]; then
    echo "Removing output directory..."
    rm -rf "${SCRIPT_DIR}/output"
fi

# Remove any temporary files
echo "Removing temporary files..."
find "${SCRIPT_DIR}" -name "*.tmp" -o -name "*.temp" -o -name "*~" | xargs -r rm -f

echo "✓ ${PROJECT} cleaned successfully"