mirror of
https://github.com/minio/minio.git
synced 2025-03-31 17:53:43 -04:00
Merge pull request #153 from vadmeste/check_for_golang_version
This commit is contained in:
commit
08c6717f88
12
checkdeps.sh
12
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
|
||||||
@ -26,6 +33,11 @@ echo -n "Checking dependencies for Minio.. "
|
|||||||
## Check all dependencies are present
|
## Check all dependencies are present
|
||||||
MISSING=""
|
MISSING=""
|
||||||
|
|
||||||
|
check_version "$(env go version | sed 's/^.* go\([0-9.]*\).*$/\1/')" "1.4.0"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
MISSING="${MISSING} golang(1.4.0)"
|
||||||
|
fi
|
||||||
|
|
||||||
env git --version > /dev/null 2>&1
|
env git --version > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
MISSING="${MISSING} git"
|
MISSING="${MISSING} git"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user