pantry/projects/crystal-lang.org/shim
Jacob Heider 6d90ced542
fix(crystal)
better shim
2023-10-23 12:51:52 -04:00

21 lines
378 B
Bash
Executable file

#!/bin/sh
cmd="$1"
shift
case "$cmd" in
build) crystal.bin "$cmd" --link-flags "${CRYSTAL_LINK_FLAGS:-}" "$@";;
eval)
TEMP=$(mktemp)
if test $# -gt 0; then
echo "$@" > "$TEMP"
else
# stdin.... hm
cat > "$TEMP"
fi
crystal.bin run --link-flags "${CRYSTAL_LINK_FLAGS:-}" "$TEMP"
rm "$TEMP"
;;
*) crystal.bin "$cmd" "$@";;
esac