Skip to content

Commit 9152d9d

Browse files
authored
Accept change by coderabbit, move only 2xx files
1 parent 5a4a504 commit 9152d9d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/wled-tools

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ fetch() {
5454
fi
5555

5656
for code in $accepted; do
57-
if [ "$response" -eq "$code" ]; then
58-
# success → move tmp into place
57+
if [ "$response" = "$code" ]; then
58+
# Accepted; only persist body for 2xx responses
5959
if [ -n "$dest" ]; then
60-
mv "$out" "$dest"
60+
if [[ "$response" =~ ^2 ]]; then
61+
mv "$out" "$dest"
62+
else
63+
rm -f "$out"
64+
fi
6165
fi
6266
return 0
6367
fi

0 commit comments

Comments
 (0)