diff --git a/hack/lib/util.sh b/hack/lib/util.sh index f652ef7aee0..5e542d99c1a 100644 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -143,11 +143,19 @@ kube::util::gen-doc() { link=$(kube::util::analytics-link "${path}") echo -e "\n${link}" >> "${tmpdir}/${file}" fi - # remove all old generated files from the destination - if [[ -e "${tmpdir}/${file}" && -n "${skipprefix}" ]]; then + # Remove all old generated files from the destination + if [[ -e "${tmpdir}/${file}" ]]; then local original generated - original=$(grep -v "^${skipprefix}" "${dest}/${file}") || : - generated=$(grep -v "^${skipprefix}" "${tmpdir}/${file}") || : + # Filter all munges from original content. + original=$(cat "${dest}/${file}" | sed '/^