fix: correctly propagate remote command exit status
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 10m7s
All checks were successful
Terraform Plan / Terraform Plan (push) Successful in 10m7s
This commit is contained in:
@@ -97,12 +97,14 @@ remote() {
|
||||
|
||||
quoted_cmd="$(printf '%q' "$cmd")"
|
||||
for candidate in "${candidates[@]}"; do
|
||||
if ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"; then
|
||||
ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"
|
||||
rc=$?
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
ACTIVE_SSH_USER="$candidate"
|
||||
return 0
|
||||
fi
|
||||
|
||||
rc=$?
|
||||
if [ "$rc" -ne 255 ]; then
|
||||
return "$rc"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user