mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-12-04 16:51:31 +01:00
zsh: simplify retry()
This commit is contained in:
parent
04bfe043ab
commit
b05fde87c2
|
@ -202,9 +202,7 @@ fvim() {
|
||||||
|
|
||||||
# retry command until it succeeds (waiting one second or $RETRY_INTERVAL)
|
# retry command until it succeeds (waiting one second or $RETRY_INTERVAL)
|
||||||
function retry() {
|
function retry() {
|
||||||
local _retry_interval
|
until $@; do sleep ${RETRY_INTERVAL:-1}; done
|
||||||
if [[ -z "$RETRY_INTERVAL" ]]; then _retry_interval=1; else _retry_interval=$RETRY_INTERVAL; fi
|
|
||||||
until $@; do sleep $_retry_interval; done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user