From de1d4e809ce1a2f7e4fdae353dfc83b63a902441 Mon Sep 17 00:00:00 2001 From: Rin Date: Sun, 5 May 2024 20:44:28 +0800 Subject: [PATCH] hmm --- dist/index.js | 5 ++--- index.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4d77459..da5362b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31083,9 +31083,8 @@ function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) qemu_wrapper(qemu_executable, qemu_args, (qemu_process) => { let runScript = core.getInput('run'); fs.writeFileSync('/tmp/run.sh', runScript); - let ssh = spawnSync('ssh', ['-tt', '-o', 'StrictHostKeyChecking=no', '-p', '2222', '-i', pubkey, 'root@localhost'], { stdio: ['inherit', 'pipe', 'pipe'] }); - ssh.stdin.write('chmod +x /tmp/run.sh'); - ssh.stdin.write('bash /tmp/run.sh'); + let ssh = spawn('ssh', ['-tt', '-o', 'StrictHostKeyChecking=no', '-p', '2222', '-i', pubkey, 'root@localhost'], { stdio: ['inherit', 'pipe', 'pipe'] }); + ssh.stdin.write(`chmod +x /tmp/run.sh\n/tmp/run.sh\n`); ssh.on('close', (code) => { show_message("info", `ssh exited with code ${code}`); qemu_process.kill(); diff --git a/index.js b/index.js index 30192d9..eb907c8 100644 --- a/index.js +++ b/index.js @@ -193,9 +193,8 @@ function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) qemu_wrapper(qemu_executable, qemu_args, (qemu_process) => { let runScript = core.getInput('run'); fs.writeFileSync('/tmp/run.sh', runScript); - let ssh = spawnSync('ssh', ['-tt', '-o', 'StrictHostKeyChecking=no', '-p', '2222', '-i', pubkey, 'root@localhost'], { stdio: ['inherit', 'pipe', 'pipe'] }); - ssh.stdin.write('chmod +x /tmp/run.sh'); - ssh.stdin.write('bash /tmp/run.sh'); + let ssh = spawn('ssh', ['-tt', '-o', 'StrictHostKeyChecking=no', '-p', '2222', '-i', pubkey, 'root@localhost'], { stdio: ['inherit', 'pipe', 'pipe'] }); + ssh.stdin.write(`chmod +x /tmp/run.sh\n/tmp/run.sh\n`); ssh.on('close', (code) => { show_message("info", `ssh exited with code ${code}`); qemu_process.kill();