fix: runSsh 恢复为与参考项目一致的 bash -lc 方式
This commit is contained in:
parent
d2445c7309
commit
f6e9c20396
@ -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, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user