Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
ejconlon committed May 17, 2024
1 parent c1e56ef commit 9bbc937
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions bin/minipat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
cd "$(dirname "$0")/.."

DEFAULT_BACKEND="midi"
USE_STRING="minipat [BACKEND]"
USE_STRING="minipat [BACKEND [SCRIPT]]"

if [ $# -eq 0 ]; then
echo "No backend specified, using default backend ${DEFAULT_BACKEND}"
Expand All @@ -23,5 +23,21 @@ if [ "${BACKEND}" == "help" ] ||
exit 0
fi

stack build --fast minipat-${BACKEND}
exec stack exec -- ghci -package minipat-${BACKEND} -ghci-script minipat-${BACKEND}/Repl.ghci
SCRIPT="minipat-${BACKEND}/Repl.ghci"

if [ $# -ne 0 ]; then
SCRIPT="$1"
shift
fi

if [ $# -ne 0 ]; then
echo "Unhandled arguments: $*"
echo "Use: ${USE_STRING}"
exit 1
fi

set -x

stack build --fast "minipat-${BACKEND}"

exec stack exec -- ghci -package "minipat-${BACKEND}" -ghci-script "${SCRIPT}"

0 comments on commit 9bbc937

Please sign in to comment.