piston/packages/mono/6.12.0/compile

24 lines
529 B
Plaintext
Raw Permalink Normal View History

2021-03-13 07:53:00 +01:00
#!/bin/bash
check_errors () {
grep -q 'error [A-Z]\+[0-9]\+:' check.txt && cat check.txt 1>&2 || cat check.txt
rm check.txt
}
2021-09-09 20:20:01 +02:00
case "${PISTON_LANGUAGE}" in
csharp)
rename 's/$/\.cs/' "$@" # Add .cs extension
csc -out:out *.cs > check.txt
check_errors
2021-09-09 20:20:01 +02:00
;;
basic)
rename 's/$/\.vb/' "$@" # Add .vb extension
vbnc -out:out *.vb > check.txt
check_errors
2021-09-09 20:20:01 +02:00
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac