Fix NOTICE generation

This commit is contained in:
Michael Aldridge 2021-03-18 01:01:56 -07:00
parent c02929e9e3
commit d4100a055e
3 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,7 @@
before: before:
hooks: hooks:
- go mod vendor - go mod vendor
- scripts/prepare.sh
builds: builds:
- goos: - goos:
- darwin - darwin

3
scripts/prepare.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
./scripts/vendor-licenses > NOTICE

View file

@ -19,7 +19,7 @@ list_files() {
generate_notice() { generate_notice() {
last= last=
$0 -all | while IFS=$'\n' read license; do $0 -all | while IFS=$'\n' read -r license; do
pkg="${license%%::*}" pkg="${license%%::*}"
if [ "$pkg" != "$license" ]; then if [ "$pkg" != "$license" ]; then
license="${license#${pkg}::}" license="${license#${pkg}::}"
@ -28,7 +28,7 @@ generate_notice() {
pkg="${pkg%/*}" pkg="${pkg%/*}"
fi fi
printf ${last:+'\n\n\n'} printf "%s" "${last:+'\n\n\n'}"
last=x last=x
echo "$pkg" | sed 'p;s/./-/g' echo "$pkg" | sed 'p;s/./-/g'