#!/usr/bin/bash
# ACT-R launcher (Fedora package). ACT-R compiles .fasl files into its tree at
# load time, so we run from a writable per-user copy seeded from the pristine
# system install.
ACTR_SRC="/usr/share/act-r"
ACTR_HOME="${ACTR_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/act-r}"
if [ ! -f "$ACTR_HOME/load-act-r.lisp" ]; then
    mkdir -p "$ACTR_HOME"
    cp -rn "$ACTR_SRC/." "$ACTR_HOME/"
fi
exec sbcl --eval "(load \"$ACTR_HOME/load-act-r.lisp\")" "$@"
