From 0fee4252606473251135b46acda0b8f69428cbd0 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 29 May 2024 14:36:01 +0900 Subject: [PATCH] fix: old path reinsertion --- dzgui.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dzgui.sh b/dzgui.sh index f557313..d817cf0 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.2.3 +version=5.2.4 #CONSTANTS aid=221100 @@ -688,6 +688,11 @@ find_library_folder(){ logger INFO "Steam path resolved to: $steam_path" } create_config(){ + #if old path is malformed and this function is forcibly called, + #wipe paths from memory before entering the loop to force path rediscovery + unset default_steam_path + unset steam_path + while true; do local player_input="$($steamsafe_zenity \ --forms \ @@ -698,8 +703,7 @@ create_config(){ --text="DZGUI" $sd_res \ --separator="@")" #explicitly setting IFS crashes $steamsafe_zenity in loop - #and mapfile does not support high ascii delimiters - #so split fields with newline + #and mapfile does not support high ascii delimiters, so split fields with newline readarray -t args < <(<<< "$player_input" sed 's/@/\n/g') name="${args[0]}" steam_api="${args[1]}" @@ -730,7 +734,7 @@ create_config(){ find_library_folder "$default_steam_path" if [[ -z $steam_path ]]; then logger raise_error "Steam path was empty" - zenity --question --text="DayZ not found or not installed at the chosen path." --ok-label="Choose path manually" --cancel-label="Exit" + zenity --question --text="DayZ not found or not installed at the Steam library given." --ok-label="Choose path manually" --cancel-label="Exit" if [[ $? -eq 0 ]]; then logger INFO "User selected file picker" file_picker