Fix: touch /dev/null permission denied on macos

Signed-off-by: song <tinysong1226@gmail.com>
This commit is contained in:
song 2025-01-15 10:41:26 +08:00
parent 643951a962
commit 11c3bd3038

View File

@ -368,7 +368,10 @@ function kube::codegen::gen_openapi() {
"${input_pkgs[@]}"
fi
touch "${report}" # in case it doesn't exist yet
if [ ! -e "${report}" ]; then
touch "${report}" # in case it doesn't exist yet
fi
if ! diff -u "${report}" "${new_report}"; then
echo -e "ERROR:"
echo -e "\tAPI rule check failed for ${report}: new reported violations"