devtool: fix retry_cmd returning error code
The initial implementation for retry_cmd was returning the
first error code of the failed command. If that command later
succeeded, the first error code would still be returned.
@@ -213,9 +213,6 @@ retry_cmd() {
{
$command
} || {
- # Save error code
- err_code=$?
-
# Command failed, substract one from retry_cnt
retry_cnt=$((retry_cnt - 1))
@@ -225,9 +222,6 @@ retry_cmd() {
sleep "$sleep_int"
retry_cmd "$command" "$retry_cnt" "$sleep_int"
fi
-
- # Set what error code docker returned
- $(exit "$err_code")
}
}
