1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

Merge pull request #115 from aclist/release/5.2.4

fix: old path reinsertion
This commit is contained in:
aclist 2024-05-29 15:15:53 +09:00 committed by GitHub
commit 14ec892848
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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