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
BUILD="Release"
UNTIL_CLEAN_EXIT=0
MONO_ARGS=("--llvm" "--server" "-O=all")
PRINT_USAGE() {
echo "Usage: $0 [debug/release]"
echo "Usage: $0 [--until-clean-exit] [debug/release]"
exit 1
}
@@ -14,6 +15,7 @@ for ARG in "$@"; do
case "$ARG" in
release|Release) BUILD="Release" ;;
debug|Debug) BUILD="Debug" ;;
--until-clean-exit) UNTIL_CLEAN_EXIT=1 ;;
*) PRINT_USAGE
esac
done
@@ -31,4 +33,14 @@ if [[ ! -f "$BINARY" ]]; then
exit 1
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