From 09cb67134bf1c908add892f5470a0c09812a9ee7 Mon Sep 17 00:00:00 2001 From: aclist Date: Tue, 29 Nov 2022 04:52:25 +0900 Subject: [PATCH] Check python explicitly --- changelog.md | 4 ++++ dzgui.sh | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 44d2fd9..685c45f 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,10 @@ - Custom query API - Standardize dialogs +## [3.1.0-rc.17] 2022-11-28 +### Changed +- Explicitly check Python version + ## [3.1.0-rc.16] 2022-11-25 ### Fixed - Hotfix for server modlists returning multiples of same mod diff --git a/dzgui.sh b/dzgui.sh index a373d11..6df5751 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o pipefail -version=3.1.0-rc.16 +version=3.1.0-rc.17 aid=221100 game="dayz" @@ -68,7 +68,7 @@ print_news(){ } declare -A deps -deps=([awk]="5.1.1" [curl]="7.80.0" [jq]="1.6" [tr]="9.0" [zenity]="3.42.1" [steam]="1.0.0" [python]="3.0") +deps=([awk]="5.1.1" [curl]="7.80.0" [jq]="1.6" [tr]="9.0" [zenity]="3.42.1" [steam]="1.0.0") changelog(){ if [[ $branch == "stable" ]]; then md="https://raw.githubusercontent.com/aclist/dztui/dzgui/changelog.md" @@ -248,6 +248,7 @@ file_picker(){ done } create_config(){ + check_pyver while true; do player_input="$(zenity --forms --add-entry="Player name (required for some servers)" --add-entry="BattleMetrics API key" --add-entry="Steam API key" --title="DZGUI" --text="DZGUI" $sd_res --separator="│" 2>/dev/null)" #explicitly setting IFS crashes zenity in loop @@ -298,6 +299,13 @@ run_depcheck(){ exit fi } +check_pyver(){ + pyver=$(python --version | awk '{print $2}') + if [[ -z $pyver ]] || [[ ${pyver:0:1} -lt 3 ]]; then + warn "Requires python >=3.0" && + exit + fi +} run_varcheck(){ source $config_file workshop_dir="$steam_path/steamapps/workshop/content/$aid"