Accept change by coderabbit, move only 2xx files

This commit is contained in:
Michael Bisbjerg
2025-09-22 21:16:02 +02:00
committed by GitHub
parent 5a4a50415e
commit 9152d9d2ed

View File

@@ -54,10 +54,14 @@ fetch() {
fi fi
for code in $accepted; do for code in $accepted; do
if [ "$response" -eq "$code" ]; then if [ "$response" = "$code" ]; then
# success → move tmp into place # Accepted; only persist body for 2xx responses
if [ -n "$dest" ]; then if [ -n "$dest" ]; then
if [[ "$response" =~ ^2 ]]; then
mv "$out" "$dest" mv "$out" "$dest"
else
rm -f "$out"
fi
fi fi
return 0 return 0
fi fi