Skip to content

Commit

Permalink
you've gotta be kidding...
Browse files Browse the repository at this point in the history
  • Loading branch information
shinohara-rin committed May 3, 2024
1 parent 1998611 commit b959938
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31021,30 +31021,30 @@ function ensure_host_ssh_key() {

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);
const qemu_process = spawn(qemu_cmd, qemu_args);

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

qemuProcess.stderr.pipe(process.stderr)
qemu_process.stderr.pipe(process.stderr)

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

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

return qemuProcess;
return qemu_process;
}

function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) {
Expand Down Expand Up @@ -31133,7 +31133,7 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
}
}
})()
qemuProcess.stdout.on('data', waitForKey);
qemu_process.stdout.on('data', waitForKey);
}

function ensure_install_deps() {
Expand Down
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,30 @@ function ensure_host_ssh_key() {

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);
const qemu_process = spawn(qemu_cmd, qemu_args);

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

qemuProcess.stderr.pipe(process.stderr)
qemu_process.stderr.pipe(process.stderr)

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

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

return qemuProcess;
return qemu_process;
}

function start_vm(qemu_version, os, cpu, arch, bios, machine, filename, pubkey) {
Expand Down Expand Up @@ -243,7 +243,7 @@ function setup_sshkey(pubkey, qemu_process, ready_callback) {
}
}
})()
qemuProcess.stdout.on('data', waitForKey);
qemu_process.stdout.on('data', waitForKey);
}

function ensure_install_deps() {
Expand Down

0 comments on commit b959938

Please sign in to comment.