[arcanist] rm -f for write protected temp files

When running `arc diff` on a newly added file,
utils/arcanist/clang-format.sh is run. For new files there is no change,
but the script will bail. Without the use of the -f flag, we get
interactive prompts like:
rm: remove write-protected regular file '/tmp/tmp.ReMybrBw35'?

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D148555
This commit is contained in:
Nick Desaulniers 2023-04-17 13:18:16 -07:00
parent 10c17c97eb
commit b3dd9041e6

View File

@ -36,7 +36,7 @@ cp -p "${src_file}" "${formatted_file}"
cleanup() {
rc=$?
rm "${formatted_file}" "${original_file}"
rm -f "${formatted_file}" "${original_file}"
exit ${rc}
}
trap 'cleanup' INT HUP QUIT TERM EXIT