mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
feat: add more startup logging
This commit is contained in:
parent
854f5fc1d3
commit
42142d999a
1 changed files with 16 additions and 4 deletions
20
dzgui.sh
20
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=3.2.17
|
version=3.2.18
|
||||||
|
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
@ -246,6 +246,7 @@ file_picker(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
create_config(){
|
create_config(){
|
||||||
|
debug "ENTERED ${FUNCNAME[0]}"
|
||||||
check_pyver
|
check_pyver
|
||||||
write_to_config(){
|
write_to_config(){
|
||||||
mkdir -p $config_path
|
mkdir -p $config_path
|
||||||
|
@ -274,15 +275,15 @@ create_config(){
|
||||||
warn "Invalid BM API key"
|
warn "Invalid BM API key"
|
||||||
else
|
else
|
||||||
while true; do
|
while true; do
|
||||||
echo "STEAMSAFEZENITY: $steamsafe_zenity" >> /tmp/debug.log
|
debug "STEAMSAFEZENITY: $steamsafe_zenity"
|
||||||
[[ -n $steam_path ]] && { write_to_config; return; }
|
[[ -n $steam_path ]] && { write_to_config; return; }
|
||||||
find_default_path
|
find_default_path
|
||||||
find_library_folder "$default_steam_path"
|
find_library_folder "$default_steam_path"
|
||||||
if [[ -z $steam_path ]]; then
|
if [[ -z $steam_path ]]; then
|
||||||
echo "STEAM PATH WAS EMPTY" >> /tmp/debug.log
|
debug "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 chosen path." --ok-label="Choose path manually" --cancel-label="Exit"
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo "USER SELECTED FILE PICKER" >> /tmp/debug.log
|
debug "USER SELECTED FILE PICKER"
|
||||||
file_picker
|
file_picker
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
|
@ -310,8 +311,13 @@ run_depcheck(){
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
debug(){
|
||||||
|
echo "$*" >> /tmp/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
|
||||||
|
@ -332,13 +338,19 @@ run_varcheck(){
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
config(){
|
config(){
|
||||||
|
debug "ENTERED ${FUNCNAME[0]}"
|
||||||
if [[ ! -f $config_file ]]; then
|
if [[ ! -f $config_file ]]; then
|
||||||
|
debug "CONFIG FILE MISSING"
|
||||||
|
debug "STEAMSAFEZENITY is $steamsafe_zenity"
|
||||||
$steamsafe_zenity --width 500 --info --text="Config file not found. Click OK to proceed to first-time setup." 2>/dev/null
|
$steamsafe_zenity --width 500 --info --text="Config file not found. Click OK to proceed to first-time setup." 2>/dev/null
|
||||||
code=$?
|
code=$?
|
||||||
|
debug "RETURN CODE WAS $code"
|
||||||
#TODO: prevent progress if user hits ESC
|
#TODO: prevent progress if user hits ESC
|
||||||
if [[ $code -eq 1 ]]; then
|
if [[ $code -eq 1 ]]; then
|
||||||
|
debug "RECEIVED EXIT CODE 1"
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
|
debug "CREATING CONFIG"
|
||||||
create_config
|
create_config
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue