#!/bin/bash

set -euo pipefail

# Keep the separately installed AI Watch bundle intact; only the full CLI
# onedir belongs to this package.
TARGET_VOLUME="${3:?missing installer target volume}"
RUNLAYER_BUNDLE="${TARGET_VOLUME%/}/usr/local/lib/runlayer/runlayer"
RUNLAYER_APP="${TARGET_VOLUME%/}/Applications/Runlayer.app"

rm -rf "$RUNLAYER_BUNDLE"
if [ -e "$RUNLAYER_APP" ]; then
    rm -rf "$RUNLAYER_APP"
fi
