Skip to content

Commit

Permalink
feat: improve install and list license script
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 30, 2024
1 parent faa9e9f commit 27dfb25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion licenses/install
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion licenses/list-licenses
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 27dfb25

Please sign in to comment.