mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-17 12:30:42 +07:00
20 lines
290 B
Bash
20 lines
290 B
Bash
function retry {
|
|
local try=0
|
|
|
|
until "$@"; do
|
|
exit_code="$?"
|
|
try=$((try + 1))
|
|
|
|
if [ $try -lt 10 ]; then
|
|
sleep "$((2 ** try))"
|
|
else
|
|
return $exit_code
|
|
fi
|
|
done
|
|
|
|
return 0
|
|
}
|
|
|
|
function git_retry {
|
|
retry git "$@"
|
|
} |