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:
hooks:
- go mod vendor
- scripts/prepare.sh
builds:
- goos:
- 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() {
last=
$0 -all | while IFS=$'\n' read license; do
$0 -all | while IFS=$'\n' read -r license; do
pkg="${license%%::*}"
if [ "$pkg" != "$license" ]; then
license="${license#${pkg}::}"
@ -28,7 +28,7 @@ generate_notice() {
pkg="${pkg%/*}"
fi
printf ${last:+'\n\n\n'}
printf "%s" "${last:+'\n\n\n'}"
last=x
echo "$pkg" | sed 'p;s/./-/g'