swarm/scripts/autoplay-tutorials.sh
Brent Yorgey a8087b725a
Recommend cabal (#1822)
Changes to documentation etc. to recommend the use of `cabal` rather than `stack`.  Closes #1820.

- [x] Update `README.md`
- [x] Update `feedback.yaml`
- [x] Update scripts in `scripts/`
- [x] Update `CONTRIBUTING.md`
- [x] Maybe HLS defaults to using Stack now? Should we create a `hie.yaml.cabal` file with `cradle: cabal:`?
    - See https://discourse.haskell.org/t/whats-the-current-status-of-hls-cradle-discovery/8254/5
    - See https://github.com/Avi-D-coder/implicit-hie
2024-05-06 00:09:33 +00:00

26 lines
557 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/..
if command -v stack &> /dev/null; then
SWARM="stack exec swarm --"
else
SWARM="cabal run -j -O0 swarm --"
fi
for tutorial in $(cat scenarios/Tutorials/00-ORDER.txt | xargs); do
echo -n "$tutorial"
$SWARM -i "scenarios/Tutorials/$tutorial" --autoplay --cheat;
echo -en "\tCONTINUE [Y/n]: "
read answer;
case "${answer:0:1}" in
n|N )
exit 1
;;
* )
;;
esac
done