Skip to content

Commit eaab63a

Browse files
authored
Skip Self When Generating LICENSES (#2856)
The script generates licenses of dependencies, but contets of kpt repository are 'self'. No need to include them. Furthemore, the `go mod vendor` is selective in populating vendor directory and may only include specific sub-modules from the kpt repository, omitting LICENSE and related file(s).
1 parent 6e2c923 commit eaab63a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/create-licenses.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ for PACKAGE in $(go list -mod=mod -m -json all | jq -r .Path | sort -f); do
188188
continue
189189
fi
190190

191+
# Skip self.
192+
# The LICENSE file is at the root but vendor directory contents are selective.
193+
if [[ "${PACKAGE}" =~ ^github.com/GoogleContainerTools/kpt(/.*)?$ ]]; then
194+
# echo "Skipping ${PACKAGE}" > /dev/stderr
195+
continue
196+
fi
197+
191198
process_content "${PACKAGE}" LICENSE
192199
process_content "${PACKAGE}" COPYRIGHT
193200
process_content "${PACKAGE}" COPYING

0 commit comments

Comments
 (0)