为 run_remote 和 rsync_to 的 expect 包装补充子进程 wait 退出码,避免 SSH 断连或 rsync 失败后脚本继续执行并误报完成。 Validation: - bash -n 通过 - Git diff 检查通过
@@ -153,6 +153,8 @@ expect {
"password:" { send -- "$password\r"; exp_continue }
eof
}
+set result [wait]
+exit [lindex $result 3]
EXPECT_EOF
@@ -178,6 +180,8 @@ expect {