From 9152d9d2ed268b0c6cc613eb561bbf387cd8609c Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Mon, 22 Sep 2025 21:16:02 +0200 Subject: [PATCH] Accept change by coderabbit, move only 2xx files --- tools/wled-tools | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/wled-tools b/tools/wled-tools index 804f9548..34fb6370 100755 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -54,10 +54,14 @@ fetch() { fi for code in $accepted; do - if [ "$response" -eq "$code" ]; then - # success → move tmp into place + if [ "$response" = "$code" ]; then + # Accepted; only persist body for 2xx responses if [ -n "$dest" ]; then - mv "$out" "$dest" + if [[ "$response" =~ ^2 ]]; then + mv "$out" "$dest" + else + rm -f "$out" + fi fi return 0 fi