@@ -6,17 +6,17 @@ command_exists () {
66 command -v " $1 " > /dev/null 2>&1
77}
88
9- # Function to compare version numbers
10- version_gt () {
11- test " $( echo " $@ " | tr " " " \n" | sort -V | head -n 1) " ! = " $1 "
9+ # Function to compare version numbers for "less than"
10+ version_lt () {
11+ test " $( echo " $@ " | tr " " " \n" | sort -V | head -n 1) " = " $1 " && test " $1 " ! = " $2 "
1212}
1313
1414missing_deps=0
1515
1616# Check for Go
1717if ! (command_exists go); then
1818 missing_deps=1
19- echo " ❌ Go (supported version between 1.18 - 1.23 ) is not installed."
19+ echo " ❌ Go (supported version between 1.20 - 1.24 ) is not installed."
2020 echo " "
2121 echo " To install Go, visit the official download page:"
2222 echo " 👉 https://go.dev/dl/"
@@ -37,17 +37,17 @@ if ! (command_exists go); then
3737 echo " "
3838fi
3939
40- # Check for the right version of Go, needed by TinyGo (supports go 1.18 - 1.23 )
40+ # Check for the right version of Go, needed by TinyGo (supports go 1.20 - 1.24 )
4141if (command_exists go); then
4242 compat=0
43- for v in ` seq 18 23 ` ; do
43+ for v in ` seq 20 24 ` ; do
4444 if (go version | grep -q " go1.$v " ); then
4545 compat=1
4646 fi
4747 done
4848
4949 if [ $compat -eq 0 ]; then
50- echo " ❌ Supported Go version is not installed. Must be Go 1.18 - 1.23 ."
50+ echo " ❌ Supported Go version is not installed. Must be Go 1.20 - 1.24 ."
5151 echo " "
5252 fi
5353fi
@@ -81,12 +81,12 @@ if ! (command_exists tinygo); then
8181else
8282 # Check TinyGo version
8383 tinygo_version=$( tinygo version | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' | head -n1)
84- if ! version_gt " $tinygo_version " " 0.34.0" ; then
84+ if version_lt " $tinygo_version " " 0.34.0" ; then
8585 missing_deps=1
86- echo " ❌ TinyGo version must be greater than 0.34.0 (current version: $tinygo_version )"
86+ echo " ❌ TinyGo version must be >= 0.34.0 (current version: $tinygo_version )"
8787 echo " Please update TinyGo to a newer version."
8888 echo " "
8989 fi
9090fi
9191
92- go install golang.org/x/tools/cmd/goimports@latest
92+ go install golang.org/x/tools/cmd/goimports@latest
0 commit comments