Skip to content

Commit ea7df63

Browse files
committed
Retry command is evaluated
Previously the command was directly executed, but that caused problems passing in compound statements. Related: conjurinc/ops#423
1 parent 78ac6b4 commit ea7df63

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

helpers/lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function retry {
4646
fi
4747

4848
local count=0
49-
until "$@"; do
49+
until eval "$@"; do
5050
# Command failed, otherwise until would have skipped the loop
5151

5252
# Store return code so it can be reported to the user

tests-for-this-repo/helpers.bats

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,8 @@ teardown(){
111111
assert [ ! -e "${temp_dir}/appendfile" ]
112112
}
113113

114-
114+
@test "retry succeeds with compound statements" {
115+
run retry 3 "true && date >> ${afile}"
116+
assert_success
117+
assert_equal $(wc -l <${afile}) 1
118+
}

0 commit comments

Comments
 (0)