From b5ab7ea7877317813aaad6f60ab2fba3ed03826c Mon Sep 17 00:00:00 2001 From: Joseph-Eugene Winzer Date: Thu, 11 Feb 2021 16:53:43 +0100 Subject: Added zig version check for commit number --- ziglings | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ziglings b/ziglings index e941411..84822ca 100755 --- a/ziglings +++ b/ziglings @@ -18,11 +18,15 @@ fmt_yay=$( tput setaf 2 ) # green foreground fmt_off=$( tput sgr0 ) # reset colors/effects zig_cmd=zig -zig_version_required=( 0 8 0 ) +# zig compiler version ( major minor patch commits_since_last_release ) +zig_version_required=( 0 8 0 1065 ) zig_version=$($zig_cmd version) zig_version=(${zig_version//./ }) +zig_version_commit=(${zig_version[3]//+/ }) -if [[ ${zig_version[0]} -ne ${zig_version_required[0]} || ${zig_version[1]} -lt ${zig_version_required[1]} ]] +if [[ ${zig_version[0]} -ne ${zig_version_required[0]} || + ${zig_version[1]} -lt ${zig_version_required[1]} || + $zig_version_commit -lt ${zig_version_required[3]} ]] then echo "Your current zig version is $(IFS=$'.'; echo "${zig_version[*]}")." echo "Please update your zig compiler to a version >=$(IFS=$'.'; echo "${zig_version_required[*]}") "` -- cgit v1.2.3-ZIG