Idris2/bootstrap/idris2-boot.sh
Ben Hormann b457d15701 [ fix #221 ] realpath alternative for macOS
Zsh is available by default on macOS
readlink -f is commonly supported on Linux and BSD
2021-05-21 18:23:50 +01:00

21 lines
419 B
Bash
Executable File

#!/bin/sh
set -e # exit on any error
if [ -z "$SCHEME" ]; then
echo "Required SCHEME env is not set."
exit 1
fi
if [ "$(uname)" = Darwin ]; then
DIR=$(zsh -c 'printf %s "$0:A:h"' "$0")
else
DIR=$(dirname "$(readlink -f -- "$0")")
fi
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" "$@"