diff --git a/scripts/install/workers.sh b/scripts/install/workers.sh index 480d665132..5855ea7271 100755 --- a/scripts/install/workers.sh +++ b/scripts/install/workers.sh @@ -43,18 +43,23 @@ do done -curl -fsSLo- https://s.id/golang-linux | bash - -export GOROOT="/home/$USER/go" -export GOPATH="/home/$USER/go/packages" -export PATH=$PATH:$GOROOT/bin:$GOPATH/bin +if [ -f "/usr/local/bin/go" ] || [ -f "/usr/bin/go" ] || [ -f "/snap/bin/go" ]; then + echo "found go!" +else + echo "Installing go!" + curl -fsSLo- https://s.id/golang-linux | bash + export GOROOT="/home/$USER/go" + export GOPATH="/home/$USER/go/packages" + export PATH=$PATH:$GOROOT/bin:$GOPATH/bin +fi if [ -d "$HOME/scorecard" ]; then echo " Scorecard already exists, skipping cloning ..." echo " Updating Scorecard ... " CURRENT_DIR=$PWD; cd $HOME/scorecard; - git pull; + git pull; + go mod tidy; go build; echo "Scorecard build done." cd $CURRENT_DIR