#!/usr/bin/env bash
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd "${script_dir}/.." && pwd)"

if command -v daylily-ec >/dev/null 2>&1; then
    exec daylily-ec delete "$@"
fi

if [[ -f "${repo_root}/daylily_ec/__main__.py" ]]; then
    cd "${repo_root}"
    exec python3 -m daylily_ec delete "$@"
fi

echo "Error: daylily-ec is not available. Run 'source ./activate' first." >&2
exit 1
