mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Add support of command-line-arguments to run.sh
This commit is contained in:
parent
0714c4e575
commit
85a70911e1
1 changed files with 8 additions and 3 deletions
11
run.sh
11
run.sh
|
@ -2,12 +2,14 @@
|
|||
set -eu
|
||||
|
||||
BUILD="Release"
|
||||
|
||||
UNTIL_CLEAN_EXIT=0
|
||||
|
||||
ASF_ARGS=()
|
||||
MONO_ARGS=("--llvm" "--server" "-O=all")
|
||||
|
||||
PRINT_USAGE() {
|
||||
echo "Usage: $0 [--until-clean-exit] [debug/release]"
|
||||
echo "Usage: $0 [--until-clean-exit] [--cryptkey=] [--path=] [--server] [debug/release]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
@ -15,6 +17,9 @@ for ARG in "$@"; do
|
|||
case "$ARG" in
|
||||
release|Release) BUILD="Release" ;;
|
||||
debug|Debug) BUILD="Debug" ;;
|
||||
--cryptkey=*) ASF_ARGS+=("--cryptkey=$(echo "$ARG" | cut -d '=' -f 2-)") ;;
|
||||
--path=*) ASF_ARGS+=("--path=$(echo "$ARG" | cut -d '=' -f 2-)") ;;
|
||||
--server) ASF_ARGS+=("--server") ;;
|
||||
--until-clean-exit) UNTIL_CLEAN_EXIT=1 ;;
|
||||
*) PRINT_USAGE
|
||||
esac
|
||||
|
@ -34,12 +39,12 @@ if [[ ! -f "$BINARY" ]]; then
|
|||
fi
|
||||
|
||||
if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then
|
||||
mono "${MONO_ARGS[@]}" "$BINARY"
|
||||
mono "${MONO_ARGS[@]}" "$BINARY" "${ASF_ARGS[@]}"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
while [[ -f "$BINARY" ]]; do
|
||||
if mono "${MONO_ARGS[@]}" "$BINARY"; then
|
||||
if mono "${MONO_ARGS[@]}" "$BINARY" "${ASF_ARGS[@]}"; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
|
|
Loading…
Reference in a new issue