fix: runSsh 恢复为与参考项目一致的 bash -lc 方式

This commit is contained in:
liufumingren 2026-07-25 02:09:10 +08:00
parent d2445c7309
commit f6e9c20396

View File

@ -220,12 +220,10 @@ function buildSshBaseArgs(config) {
}
function runSsh(config, remoteScript, options = {}) {
// Base64 编码脚本传给远端 bash,避免 shell 嵌套引用和输出信号问题
const encoded = Buffer.from(remoteScript, 'utf8').toString('base64');
const args = [
...buildSshBaseArgs(config),
`${config.username}@${config.host}`,
`echo ${quoteForBash(encoded)} | base64 -d | bash`,
`bash -lc ${quoteForBash(remoteScript)}`,
];
return runCommand('ssh', args, {