diff --git a/.goreleaser.yml b/.goreleaser.yml index ecbe0f3..b1d2692 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,7 @@ before: hooks: - go mod vendor + - scripts/prepare.sh builds: - goos: - darwin diff --git a/scripts/prepare.sh b/scripts/prepare.sh new file mode 100755 index 0000000..a40b20f --- /dev/null +++ b/scripts/prepare.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./scripts/vendor-licenses > NOTICE diff --git a/scripts/vendor-licenses b/scripts/vendor-licenses index 2a418fd..e09f235 100755 --- a/scripts/vendor-licenses +++ b/scripts/vendor-licenses @@ -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'