A convenient CLI tool to quickly spin up DragonflyBSD virtual machines using QEMU with sensible defaults.
1import { setupOrasBinary } from "../oras.ts";
2
3export default async function (
4 username: string,
5 password: string,
6 reqistry: string,
7) {
8 await setupOrasBinary();
9
10 const cmd = new Deno.Command("oras", {
11 args: [
12 "login",
13 "--username",
14 username,
15 "--password-stdin",
16 reqistry,
17 ],
18 stdin: "piped",
19 stderr: "inherit",
20 stdout: "inherit",
21 });
22
23 const process = cmd.spawn();
24 if (process.stdin) {
25 const writer = process.stdin.getWriter();
26 await writer.write(new TextEncoder().encode(password + "\n"));
27 writer.close();
28 }
29
30 const status = await process.status;
31
32 if (!status.success) {
33 Deno.exit(status.code);
34 }
35}