From b0f79365a966dc1a925bcb5ea018893a8cb6f6a6 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 23 Feb 2021 16:14:27 -0500 Subject: [PATCH] Noninteractive installation added with the -I flag. --- audiogame-manager.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index fa09638..e7e539c 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -279,6 +279,10 @@ install_wine_bottle() { export WINEARCH="${WINEARCH:-win32}" local bottle="${game,,}" bottle="${bottle//[[:space:]]/-}" + if [[ -d "$HOME/.local/wine/${bottle}" ]]; then + echo "$HOME/.local/wine/${bottle} exists. Please remove it before running this installer." + exit 1 + fi mkdir -p "$HOME/.local/wine/${bottle}" export WINEPREFIX="$HOME/.local/wine/${bottle}" # Arguments to the function are dependancies to be installed. @@ -613,6 +617,7 @@ declare -A command=( [d]="Debug mode, wine will be much more verbose when games are launched with this flag." [h]="This help screen." [i]="Install games." + [I:]="Noninteractive game installation." [k]="Kill a running game that is stuck." [L]="Display license information." [l:]="Launch given game without interactive audiogame-manager menu specified by its wine bottle." @@ -633,6 +638,9 @@ while getopts "${args}" i ; do ;; h) help;; i) game_installer;; + I) + game="${OPTARG}" + break;; k) kill_game;; L) license;; l) game_launcher "${OPTARG}";; @@ -1262,7 +1270,8 @@ EOF open_url "https://patreon.com/stormux" ;; *) - exit 0 + [[ -n "${game}" ]] && echo "Game \"${game}\" not found." + exit 1 ;; esac