1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-03 16:21:32 +01:00

zsh: simplify retry()

This commit is contained in:
bretello 2024-01-26 14:45:42 +01:00
parent 04bfe043ab
commit b05fde87c2
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -202,9 +202,7 @@ fvim() {
# retry command until it succeeds (waiting one second or $RETRY_INTERVAL)
function retry() {
local _retry_interval
if [[ -z "$RETRY_INTERVAL" ]]; then _retry_interval=1; else _retry_interval=$RETRY_INTERVAL; fi
until $@; do sleep $_retry_interval; done
until $@; do sleep ${RETRY_INTERVAL:-1}; done
}