Fix SSH command quoting — pass cmd directly, drop sh -c wrapper

This commit is contained in:
jtricerolph 2026-07-14 15:20:52 +00:00
parent 603a41f04a
commit 801b1e6bd8

View file

@ -133,7 +133,7 @@ async function sshExec(host, command) {
'-o', 'UserKnownHostsFile=/dev/null', '-o', 'UserKnownHostsFile=/dev/null',
'-o', 'ConnectTimeout=5', '-o', 'ConnectTimeout=5',
`root@${host}`, `root@${host}`,
'sh', '-c', command, command,
], { shell: false }) ], { shell: false })
let stdout = '', stderr = '' let stdout = '', stderr = ''
child.stdout?.on('data', d => { stdout += d }) child.stdout?.on('data', d => { stdout += d })
@ -208,7 +208,7 @@ async function runRemote(target, repoName, cmd, label) {
'-o', 'StrictHostKeyChecking=no', '-o', 'StrictHostKeyChecking=no',
'-o', 'UserKnownHostsFile=/dev/null', '-o', 'UserKnownHostsFile=/dev/null',
`root@${target.host}`, `root@${target.host}`,
'sh', '-c', cmd, cmd,
], { timeout: 300_000 }) ], { timeout: 300_000 })
entry.status = 'success' entry.status = 'success'
entry.output = stdout.slice(-500) entry.output = stdout.slice(-500)