From 6ec26a5769f41d28606c124276b5b099621ade8e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 16 Jun 2024 23:02:59 +0200 Subject: [PATCH] Add scripts for building EDSL scripts --- Exercises/exercise-6/.gitignore | 1 + Exercises/exercise-6/build.sh | 7 +++++++ Exercises/exercise-6/watch.sh | 10 ++++++++++ 3 files changed, 18 insertions(+) create mode 100644 Exercises/exercise-6/.gitignore create mode 100755 Exercises/exercise-6/build.sh create mode 100755 Exercises/exercise-6/watch.sh diff --git a/Exercises/exercise-6/.gitignore b/Exercises/exercise-6/.gitignore new file mode 100644 index 0000000..2211df6 --- /dev/null +++ b/Exercises/exercise-6/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/Exercises/exercise-6/build.sh b/Exercises/exercise-6/build.sh new file mode 100755 index 0000000..f11bad2 --- /dev/null +++ b/Exercises/exercise-6/build.sh @@ -0,0 +1,7 @@ +for shape in "shape1" "shape2" "shape3" "iShape" "disc50" +do + pushd "${BASH_SOURCE%/*}" > /dev/null + ghc ./Shapes.hs -e "render 100 100 $shape" + mv shape.txt "$shape.txt" + popd > /dev/null +done diff --git a/Exercises/exercise-6/watch.sh b/Exercises/exercise-6/watch.sh new file mode 100755 index 0000000..fd3a954 --- /dev/null +++ b/Exercises/exercise-6/watch.sh @@ -0,0 +1,10 @@ +pushd "${BASH_SOURCE%/*}" > /dev/null + +nix-shell -p entr bash --run \ + "ls *.hs | \ + entr -rs ' \ + ./build.sh + ' \ + " + +popd > /dev/null