mirror of
https://github.com/aclist/dztui.git
synced 2024-12-29 13:52:03 +01:00
fix: restore log generation
This commit is contained in:
parent
486938fd39
commit
a73a7e7e42
1 changed files with 28 additions and 8 deletions
36
dzgui.sh
36
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=3.3.7
|
version=3.3.11
|
||||||
|
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
@ -332,9 +332,7 @@ logger(){
|
||||||
printf "[%s] [%s] %s\n" "$date" "$tag" "$string" >> "$debug_log"
|
printf "[%s] [%s] %s\n" "$date" "$tag" "$string" >> "$debug_log"
|
||||||
}
|
}
|
||||||
check_pyver(){
|
check_pyver(){
|
||||||
debug "ENTERED ${FUNCNAME[0]}"
|
|
||||||
pyver=$(python3 --version | awk '{print $2}')
|
pyver=$(python3 --version | awk '{print $2}')
|
||||||
debug "PYVER is $pyver"
|
|
||||||
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]]; then
|
if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]]; then
|
||||||
warn "Requires python >=3.0" &&
|
warn "Requires python >=3.0" &&
|
||||||
exit
|
exit
|
||||||
|
@ -1208,7 +1206,7 @@ options_menu(){
|
||||||
debug_list=(
|
debug_list=(
|
||||||
"Toggle branch"
|
"Toggle branch"
|
||||||
"Toggle debug mode"
|
"Toggle debug mode"
|
||||||
"Generate debug log"
|
"Output system info"
|
||||||
"Toggle auto mod install [$auto_hr]"
|
"Toggle auto mod install [$auto_hr]"
|
||||||
)
|
)
|
||||||
#TODO: tech debt: drop old flags
|
#TODO: tech debt: drop old flags
|
||||||
|
@ -1227,11 +1225,12 @@ options_menu(){
|
||||||
check_version
|
check_version
|
||||||
;;
|
;;
|
||||||
"Toggle debug mode") toggle_debug ;;
|
"Toggle debug mode") toggle_debug ;;
|
||||||
"Generate debug log")
|
"Output system info")
|
||||||
source_script=$(realpath "$0")
|
source_script=$(realpath "$0")
|
||||||
source_dir=$(dirname "$source_script")
|
source_dir=$(dirname "$source_script")
|
||||||
printf "[DZGUI] Wrote log file to %s/log\n" "$source_dir"
|
generate_log > "$source_dir/DZGUI.log"
|
||||||
$steamsafe_zenity --info --width=500 --title="DZGUI" --text="Wrote log file to \n$source_dir/log" 2>/dev/null
|
$steamsafe_zenity --info --width=500 --title="DZGUI" --text="Wrote log file to \n$source_dir/log" 2>/dev/null
|
||||||
|
printf "[DZGUI] Wrote log file to %s/log\n" "$source_dir"
|
||||||
;;
|
;;
|
||||||
Toggle[[:space:]]auto*) toggle_console_dl ;;
|
Toggle[[:space:]]auto*) toggle_console_dl ;;
|
||||||
"Force update local mods")
|
"Force update local mods")
|
||||||
|
@ -1387,7 +1386,7 @@ get_dist(){
|
||||||
echo "$dist"
|
echo "$dist"
|
||||||
else
|
else
|
||||||
local dist=$($km_helper "$local_lat" "$local_lon" "$remote_lat" "$remote_lon")
|
local dist=$($km_helper "$local_lat" "$local_lon" "$remote_lat" "$remote_lon")
|
||||||
printf "%05.0f %s" "$dist" "km"
|
LC_NUMERIC=C printf "%05.0f %s" "$dist" "km"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
prepare_filters(){
|
prepare_filters(){
|
||||||
|
@ -1904,9 +1903,30 @@ initial_setup(){
|
||||||
check_news
|
check_news
|
||||||
echo "100"
|
echo "100"
|
||||||
}
|
}
|
||||||
|
test_zenity_version(){
|
||||||
|
local current="$1"
|
||||||
|
local cutoff="3.91.0"
|
||||||
|
if [[ "$(printf '%s\n' "$cutoff" "$current" | sort -V | head -n1)" == "$cutoff" ]]; then
|
||||||
|
logger INFO "zenity version greater than or equal to $cutoff"
|
||||||
|
echo greater
|
||||||
|
else
|
||||||
|
logger INFO "zenity version lesser than $cutoff"
|
||||||
|
echo lesser
|
||||||
|
fi
|
||||||
|
}
|
||||||
main(){
|
main(){
|
||||||
lock
|
lock
|
||||||
initial_setup > >($steamsafe_zenity --pulsate --progress --auto-close --title="DZGUI" --no-cancel --width=500 2>/dev/null)
|
local zenv=$(zenity --version 2>/dev/null)
|
||||||
|
[[ -z $zenv ]] && { logger "Missing zenity"; exit; }
|
||||||
|
local res=$(test_zenity_version $zenv)
|
||||||
|
case $res in
|
||||||
|
"greater")
|
||||||
|
initial_setup
|
||||||
|
;;
|
||||||
|
"lesser")
|
||||||
|
initial_setup > >($steamsafe_zenity --pulsate --progress --auto-close --title="DZGUI" --no-cancel --width=500 2>/dev/null)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
main_menu
|
main_menu
|
||||||
#TODO: tech debt: cruddy handling for steam forking
|
#TODO: tech debt: cruddy handling for steam forking
|
||||||
[[ $? -eq 1 ]] && pkill -f dzgui.sh
|
[[ $? -eq 1 ]] && pkill -f dzgui.sh
|
||||||
|
|
Loading…
Reference in a new issue