Idris2/bootstrap/idris2-boot.sh

31 lines
587 B
Bash
Raw Normal View History

#!/bin/sh
set -e # exit on any error
if [ -z "$SCHEME" ]; then
echo "Required SCHEME env is not set."
exit 1
fi
case $(uname -s) in
OpenBSD | FreeBSD | NetBSD)
REALPATH="grealpath"
;;
*)
REALPATH="realpath"
;;
esac
if ! command -v "$REALPATH" >/dev/null; then
echo "$REALPATH is required for Chez code generator."
exit 1
fi
DIR=$(dirname "$($REALPATH "$0")")
LD_LIBRARY_PATH="$DIR/idris2_app":$LD_LIBRARY_PATH
PATH="$DIR/idris2_app":$PATH
export LD_LIBRARY_PATH PATH
${SCHEME} --script "$DIR/idris2_app/idris2-boot.so" "$@"