2020-05-19 20:25:18 +03:00
|
|
|
# This test needs to run `idris2` from a sub-folder.
|
|
|
|
# Split path to `idris2` executable into dirname and basename.
|
|
|
|
# If the path is relative, add `..` to compensate for running `idris2` in a sub-folder.
|
|
|
|
case "$1" in
|
|
|
|
/*)
|
|
|
|
# Absolute path
|
|
|
|
IDRIS2_DIR="$(dirname "$1")"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# Relative path
|
2020-05-19 23:02:15 +03:00
|
|
|
IDRIS2_DIR="../$(dirname "$1")"
|
2020-05-19 20:25:18 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
IDRIS2_EXEC="$(basename "$1")"
|
|
|
|
|
|
|
|
cd "folder with spaces" || exit
|
|
|
|
|
2020-07-28 15:11:42 +03:00
|
|
|
"$IDRIS2_DIR/$IDRIS2_EXEC" --no-color --no-banner Main.idr < ../input
|
2020-05-19 20:25:18 +03:00
|
|
|
rm -rf build
|