mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
hack/update-vendor-licenses.sh: skip empty packages
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
b67e7d6e2c
commit
78d295d168
@ -196,6 +196,20 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do
|
|||||||
echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2
|
echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
# Skip a directory if 1) it has no files and 2) all the subdirectories contain a go.mod file.
|
||||||
|
if [[ -z "$(find "${DEPS_DIR}/${PACKAGE}" -mindepth 1 -maxdepth 1 -type f)" ]]; then
|
||||||
|
misses_go_mod=false
|
||||||
|
while read -d "" -r SUBDIR; do
|
||||||
|
if [[ ! -e "${SUBDIR}/go.mod" ]]; then
|
||||||
|
misses_go_mod=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < <(find "${DEPS_DIR}/${PACKAGE}" -mindepth 1 -maxdepth 1 -type d -print0)
|
||||||
|
if [[ $misses_go_mod = false ]]; then
|
||||||
|
echo "${PACKAGE} has no files, skipping" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
echo "${PACKAGE}"
|
echo "${PACKAGE}"
|
||||||
|
|
||||||
process_content "${PACKAGE}" LICENSE
|
process_content "${PACKAGE}" LICENSE
|
||||||
|
Loading…
Reference in New Issue
Block a user