fix shellcheck failures of hack/update-vendor-licenses.sh

k3s-v1.15.3
SataQiu 2019-04-09 11:31:46 +08:00
parent 65dc445aa2
commit 67509020ca
2 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,6 @@
./hack/update-gofmt.sh
./hack/update-openapi-spec.sh
./hack/update-translations.sh
./hack/update-vendor-licenses.sh
./hack/update-vendor.sh
./hack/update-workspace-mirror.sh
./hack/verify-api-groups.sh

View File

@ -93,7 +93,8 @@ process_content () {
esac
# Find files - only root and package level
local_files=($(
local_files=()
IFS=" " read -r -a local_files <<< "$(
for dir_root in ${package} ${package_root}; do
[[ -d ${DEPS_DIR}/${dir_root} ]] || continue
@ -101,7 +102,7 @@ process_content () {
find "${DEPS_DIR}/${dir_root}" \
-xdev -follow -maxdepth ${find_maxdepth} \
-type f "${find_names[@]}"
done | sort -u))
done | sort -u)"
local index
local f
@ -126,13 +127,13 @@ process_content () {
#############################################################################
# MAIN
#############################################################################
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
export GO111MODULE=on
# Check bash version
if ((${BASH_VERSINFO[0]}<4)); then
if (( BASH_VERSINFO[0] < 4 )); then
echo
echo "ERROR: Bash v4+ required."
# Extra help for OSX
@ -161,7 +162,7 @@ echo "= Kubernetes licensed under: ="
echo
cat "${LICENSE_ROOT}/LICENSE"
echo
echo "= LICENSE $(cat "${LICENSE_ROOT}/LICENSE" | md5sum | awk '{print $1}')"
echo "= LICENSE $(md5sum < "${LICENSE_ROOT}/LICENSE" | awk '{print $1}')"
echo "================================================================================"
) > ${TMP_LICENSE_FILE}
@ -210,7 +211,7 @@ __EOF__
cat "${file}"
echo
echo "= ${file} $(cat "${file}" | md5sum | awk '{print $1}')"
echo "= ${file} $(md5sum < "${file}" | awk '{print $1}')"
echo "================================================================================"
echo
done >> ${TMP_LICENSE_FILE}