SkiaSharp/scripts/retry-command.sh

21 строка
517 B
Bash
Executable File

function retry()
{
local Attempt=0
local RetryCount=$1
shift
while true; do
"$@" && break || {
((Attempt++))
if [[ $Attempt -lt $RetryCount ]]; then
echo "##vso[task.logissue type=warning] ($Attempt of $RetryCount) Script failed to execute, retrying..."
else
echo "##vso[task.logissue type=warning] ($Attempt of $RetryCount) Script failed to execute.">&2
exit 1
fi
}
done
}
retry $*