Add a generic version checker function

master
Anis Elleuch 10 years ago
parent e0b9a2f9ef
commit 2ef1df016b
  1. 7
      checkdeps.sh

@ -1,5 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
check_version() {
local version=$1 check=$2
local highest=$(echo -e "$version\n$check" | sort -nrt. -k1,1 -k2,2 -k3,3 | head -1)
[[ "$highest" = "$version" ]] && return 0
return 1
}
echo -n "Checking if proper environment variables are set.. " echo -n "Checking if proper environment variables are set.. "
echo ${GOROOT:?} 2>&1 >/dev/null echo ${GOROOT:?} 2>&1 >/dev/null

Loading…
Cancel
Save