mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-30 14:06:08 +02:00
fix detecting go
This commit is contained in:
@@ -13,18 +13,18 @@ if [ ${#GOPATH} -eq 0 ]; then
|
|||||||
export PATH=$PATH:$GOPATH/bin
|
export PATH=$PATH:$GOPATH/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# precheck if go is installed
|
# make sure go is installed
|
||||||
result=$(command -v go >/dev/null 2>/dev/null)
|
goInstalled=$(go version 2>/dev/null | grep -c 'go')
|
||||||
if [ ${#result} -eq 0 ];then
|
if [ ${goInstalled} -eq 0 ];then
|
||||||
echo "### Installing GO ###"
|
echo "### Installing GO ###"
|
||||||
wget https://storage.googleapis.com/golang/go1.11.linux-armv6l.tar.gz
|
wget https://storage.googleapis.com/golang/go1.11.linux-armv6l.tar.gz
|
||||||
sudo tar -C /usr/local -xzf go1.11.linux-armv6l.tar.gz
|
sudo tar -C /usr/local -xzf go1.11.linux-armv6l.tar.gz
|
||||||
sudo rm *.gz
|
sudo rm *.gz
|
||||||
sudo mkdir /usr/local/gocode
|
sudo mkdir /usr/local/gocode
|
||||||
sudo chmod 777 /usr/local/gocode
|
sudo chmod 777 /usr/local/gocode
|
||||||
result=$(command -v go >/dev/null 2>/dev/null)
|
goInstalled=$(go version 2>/dev/null | grep -c 'go')
|
||||||
fi
|
fi
|
||||||
if [ ${#result} -eq 0 ];then
|
if [ ${goInstalled} -eq 0 ];then
|
||||||
echo "FAIL: Was not able to install GO (needed to run ZapConnect)"
|
echo "FAIL: Was not able to install GO (needed to run ZapConnect)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user