Add --until-clean-exit

This commit is contained in:
JustArchi
2016-07-11 19:22:25 +02:00
parent 55c1674309
commit 658d6129a7

16
run.sh
View File

@@ -2,11 +2,12 @@
set -eu set -eu
BUILD="Release" BUILD="Release"
UNTIL_CLEAN_EXIT=0
MONO_ARGS=("--llvm" "--server" "-O=all") MONO_ARGS=("--llvm" "--server" "-O=all")
PRINT_USAGE() { PRINT_USAGE() {
echo "Usage: $0 [debug/release]" echo "Usage: $0 [--until-clean-exit] [debug/release]"
exit 1 exit 1
} }
@@ -14,6 +15,7 @@ for ARG in "$@"; do
case "$ARG" in case "$ARG" in
release|Release) BUILD="Release" ;; release|Release) BUILD="Release" ;;
debug|Debug) BUILD="Debug" ;; debug|Debug) BUILD="Debug" ;;
--until-clean-exit) UNTIL_CLEAN_EXIT=1 ;;
*) PRINT_USAGE *) PRINT_USAGE
esac esac
done done
@@ -31,4 +33,14 @@ if [[ ! -f "$BINARY" ]]; then
exit 1 exit 1
fi fi
mono "${MONO_ARGS[@]}" "$BINARY" if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then
mono "${MONO_ARGS[@]}" "$BINARY"
exit $?
fi
while [[ -f "$BINARY" ]]; do
if mono "${MONO_ARGS[@]}" "$BINARY"; then
break
fi
sleep 1
done