Skip to content

Commit 2cd3da3

Browse files
committed
MAINT: Handle multi-line and quoted arguments better in retry_cmd
1 parent f7007ad commit 2cd3da3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/retry_cmd.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ while true; do
1919
esac
2020
done
2121

22+
# Normalize whitespace in command, preserving quotes
23+
CMD=""
24+
for ARG; do
25+
CMD="$CMD \"$ARG\"";
26+
done
27+
2228
RET=0
2329
for i in `seq $NLOOPS`; do
24-
sh -c "$@"
30+
sh -c "$CMD"
2531
RET="$?"
2632
if [ "$RET" -eq 0 ]; then break; fi
2733
if [ "$i" -ne "$NLOOPS" ]; then sleep $TOSLEEP; fi

0 commit comments

Comments
 (0)