Skip to content

Commit

Permalink
ahhhh revert
Browse files Browse the repository at this point in the history
  • Loading branch information
shinohara-rin committed Mar 17, 2024
1 parent 9325068 commit ecb67f1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31024,6 +31024,32 @@ function ensure_host_ssh_key() {
return pubkey;
};

function qemu_wrapper(qemu_cmd, qemu_args, ready_callback) {
show_message("info", 'starting qemu process with command: ' + qemu_cmd + ' ' + qemu_args.join(' '));
const qemuProcess = spawn(qemu_cmd, qemu_args);

let waitForLogin = (() => {
let concat = ''
return (data) => {
concat += data.toString()
if (concat.includes('login')) {
ready_callback(qemuProcess)
waitForLogin = () => { }
}
}
})()

qemuProcess.stdout.on('data', (data) => {
waitForLogin(data)
});

qemuProcess.on('close', (code) => {
show_message("info", `qemu exited with code ${code}`);
});

return qemuProcess;
}

function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) {
core.startGroup("Start VM");
show_message("info", "Starting VM");
Expand Down
26 changes: 26 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,32 @@ function ensure_host_ssh_key() {
return pubkey;
};

function qemu_wrapper(qemu_cmd, qemu_args, ready_callback) {
show_message("info", 'starting qemu process with command: ' + qemu_cmd + ' ' + qemu_args.join(' '));
const qemuProcess = spawn(qemu_cmd, qemu_args);

let waitForLogin = (() => {
let concat = ''
return (data) => {
concat += data.toString()
if (concat.includes('login')) {
ready_callback(qemuProcess)
waitForLogin = () => { }
}
}
})()

qemuProcess.stdout.on('data', (data) => {
waitForLogin(data)
});

qemuProcess.on('close', (code) => {
show_message("info", `qemu exited with code ${code}`);
});

return qemuProcess;
}

function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) {
core.startGroup("Start VM");
show_message("info", "Starting VM");
Expand Down

0 comments on commit ecb67f1

Please sign in to comment.