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:
parent
04bfe043ab
commit
b05fde87c2
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user