Cleanup dependency code on macOS and add retry to git fetch

This commit is contained in:
Shivam Mathur
2024-03-18 09:02:23 +05:30
parent 48e0de2ea6
commit 21eeae309a
2 changed files with 22 additions and 20 deletions

View File

@ -0,0 +1,20 @@
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 "$@"
}