2016-03-29 20:58:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
BUILD="Release"
|
2016-07-11 17:22:25 +00:00
|
|
|
UNTIL_CLEAN_EXIT=0
|
2016-03-29 20:58:18 +00:00
|
|
|
|
2016-06-02 22:16:31 +00:00
|
|
|
MONO_ARGS=("--llvm" "--server" "-O=all")
|
2016-03-29 20:58:18 +00:00
|
|
|
|
|
|
|
PRINT_USAGE() {
|
2016-07-11 17:22:25 +00:00
|
|
|
echo "Usage: $0 [--until-clean-exit] [debug/release]"
|
2016-03-29 20:58:18 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
for ARG in "$@"; do
|
|
|
|
case "$ARG" in
|
|
|
|
release|Release) BUILD="Release" ;;
|
|
|
|
debug|Debug) BUILD="Debug" ;;
|
2016-07-11 17:22:25 +00:00
|
|
|
--until-clean-exit) UNTIL_CLEAN_EXIT=1 ;;
|
2016-03-29 20:58:18 +00:00
|
|
|
*) PRINT_USAGE
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-05-18 00:46:29 +00:00
|
|
|
if [[ "$BUILD" = "Debug" ]]; then
|
|
|
|
MONO_ARGS+=("--debug")
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$(dirname "$(readlink -f "$0")")"
|
|
|
|
|
2016-03-29 20:58:18 +00:00
|
|
|
BINARY="ArchiSteamFarm/bin/$BUILD/ArchiSteamFarm.exe"
|
|
|
|
|
|
|
|
if [[ ! -f "$BINARY" ]]; then
|
|
|
|
echo "ERROR: $BINARY could not be found!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-07-11 17:22:25 +00:00
|
|
|
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
|