From 6ea013708eea8f12486688594f01db08fa071572 Mon Sep 17 00:00:00 2001 From: David Trudgian Date: Tue, 27 Aug 2024 14:30:11 +0100 Subject: [PATCH] fix: run go-licenses correctly with downloaded go (release-4.2) Pick #3265 If the go toolchain is downloaded due to installed version vs go.mod then we need to set GOROOT for go-licenses to run correctly. See: https://github.com/google/go-licenses/issues/149 --- scripts/update-license-dependencies.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/update-license-dependencies.sh b/scripts/update-license-dependencies.sh index cd1446afb8..fddb25aff0 100755 --- a/scripts/update-license-dependencies.sh +++ b/scripts/update-license-dependencies.sh @@ -3,8 +3,6 @@ set -e set -u -go install github.com/google/go-licenses@v1.6.0 - if [ -d "vendor" ]; then echo "Please remove vendor directory before running this script" exit 255 @@ -16,4 +14,4 @@ if [ ! -f "go.mod" ]; then exit 255 fi -go-licenses report ./... --ignore github.com/sylabs/singularity/v4 --template scripts/LICENSE_DEPENDENCIES.tpl > LICENSE_DEPENDENCIES.md +$(go env GOROOT)/bin/go run github.com/google/go-licenses@v1.6.0 report ./... --ignore github.com/sylabs/singularity/v4 --template scripts/LICENSE_DEPENDENCIES.tpl > LICENSE_DEPENDENCIES.md