Noninteractive installation added with the -I flag.

This commit is contained in:
Storm Dragon 2021-02-23 16:14:27 -05:00
parent b7c34a2dbe
commit b0f79365a9

View File

@ -279,6 +279,10 @@ install_wine_bottle() {
export WINEARCH="${WINEARCH:-win32}" export WINEARCH="${WINEARCH:-win32}"
local bottle="${game,,}" local bottle="${game,,}"
bottle="${bottle//[[:space:]]/-}" 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}" mkdir -p "$HOME/.local/wine/${bottle}"
export WINEPREFIX="$HOME/.local/wine/${bottle}" export WINEPREFIX="$HOME/.local/wine/${bottle}"
# Arguments to the function are dependancies to be installed. # 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." [d]="Debug mode, wine will be much more verbose when games are launched with this flag."
[h]="This help screen." [h]="This help screen."
[i]="Install games." [i]="Install games."
[I:]="Noninteractive game installation."
[k]="Kill a running game that is stuck." [k]="Kill a running game that is stuck."
[L]="Display license information." [L]="Display license information."
[l:]="Launch given game without interactive audiogame-manager menu specified by its wine bottle." [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;; h) help;;
i) game_installer;; i) game_installer;;
I)
game="${OPTARG}"
break;;
k) kill_game;; k) kill_game;;
L) license;; L) license;;
l) game_launcher "${OPTARG}";; l) game_launcher "${OPTARG}";;
@ -1262,7 +1270,8 @@ EOF
open_url "https://patreon.com/stormux" open_url "https://patreon.com/stormux"
;; ;;
*) *)
exit 0 [[ -n "${game}" ]] && echo "Game \"${game}\" not found."
exit 1
;; ;;
esac esac