mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-08 19:20:47 -05:00
Added zig version check for commit number
This commit is contained in:
parent
c46245f727
commit
58e8ceb705
1 changed files with 6 additions and 2 deletions
8
ziglings
8
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[*]}") "`
|
||||
|
|
Loading…
Reference in a new issue