From 4c2985e1448ee5e4b2b8c0612b08450599c9ccd2 Mon Sep 17 00:00:00 2001 From: Christoph Blecker Date: Wed, 5 Apr 2017 13:01:33 -0700 Subject: [PATCH] Update gen_api_ref_docs to use same diff method as verify --- hack/lib/swagger.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hack/lib/swagger.sh b/hack/lib/swagger.sh index 70afb7b87a0..bea1a5f7187 100644 --- a/hack/lib/swagger.sh +++ b/hack/lib/swagger.sh @@ -130,17 +130,10 @@ kube::swagger::gen_api_ref_docs() { while read file; do if [[ -e "${output_dir}/${file}" && -e "${output_tmp}/${file}" ]]; then echo "comparing ${output_dir}/${file} with ${output_tmp}/${file}" - # Filter all munges from original content. - original=$(cat "${output_dir}/${file}") - generated=$(cat "${output_tmp}/${file}") - - # Filter out meaningless lines with timestamps - original=$(echo "${original}" | grep -v "Last updated" || :) - generated=$(echo "${generated}" | grep -v "Last updated" || :) # By now, the contents should be normalized and stripped of any # auto-managed content. - if diff -B >/dev/null <(echo "${original}") <(echo "${generated}"); then + if diff -NauprB -I 'Last update' "${output_dir}/${file}" "${output_tmp}/${file}" >/dev/null; then # actual contents same, overwrite generated with original. cp "${output_dir}/${file}" "${output_tmp}/${file}" fi