diff --git a/licenses/install b/licenses/install index 8194d23..4feda35 100755 --- a/licenses/install +++ b/licenses/install @@ -22,7 +22,7 @@ if [ -f go.mod ]; then echo "Installing the Go license checker ..." echo } 2>/dev/null - GOBIN=$(pwd)/.bin go install github.com/google/go-licenses@latest + GOBIN=$(pwd)/.bin go install github.com/google/go-licenses@master curl https://raw.githubusercontent.com/ory/ci/master/licenses/license-template-go.tpl -o .bin/license-template-go.tpl fi diff --git a/licenses/list-licenses b/licenses/list-licenses index ae671c0..2d8b90e 100755 --- a/licenses/list-licenses +++ b/licenses/list-licenses @@ -14,6 +14,9 @@ if [ -f go.mod ]; then echo "Cannot determine the Go module name" >&2 exit 1 fi - .bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null + + # Workaround until https://github.com/google/go-licenses/issues/307 is fixed + # .bin/go-licenses report "$module_name" --template .bin/license-template-go.tpl 2>/dev/null + go list -f "{{if not .Indirect}}{{.Path}}{{end}}" -m ... | xargs -I {} sh -c '.bin/go-licenses report --template .bin/license-template-go.tpl {}' 2>/dev/null | grep -v '^$' { echo; } 2>/dev/null fi