From aa1965b6f98f41bc4040148344341ac9a493ddbc Mon Sep 17 00:00:00 2001 From: "Sean P. Goggins" Date: Fri, 9 Sep 2022 10:13:53 -0500 Subject: [PATCH 1/2] midway check on go install --- scripts/install/workers.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/install/workers.sh b/scripts/install/workers.sh index 480d665132..e73325ffee 100755 --- a/scripts/install/workers.sh +++ b/scripts/install/workers.sh @@ -43,11 +43,15 @@ 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" ]; 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 ..." From 3a3e60ad4b16ddee8ef588268a20ec40aaba652b Mon Sep 17 00:00:00 2001 From: Sean Goggins Date: Sun, 11 Sep 2022 12:25:43 -0500 Subject: [PATCH 2/2] scorecard install adaptation for evolving go versions --- scripts/install/workers.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install/workers.sh b/scripts/install/workers.sh index e73325ffee..5855ea7271 100755 --- a/scripts/install/workers.sh +++ b/scripts/install/workers.sh @@ -43,7 +43,7 @@ do done -if [ -f "/usr/local/bin/go" ]; then +if [ -f "/usr/local/bin/go" ] || [ -f "/usr/bin/go" ] || [ -f "/snap/bin/go" ]; then echo "found go!" else echo "Installing go!" @@ -58,7 +58,8 @@ if [ -d "$HOME/scorecard" ]; then 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