A convenient CLI tool to quickly spin up DragonflyBSD virtual machines using QEMU with sensible defaults.
1import { Effect, pipe } from "effect";
2import { pullImage, setupOrasBinary } from "../oras.ts";
3import { validateImage } from "../utils.ts";
4
5export default async function (image: string): Promise<void> {
6 await Effect.runPromise(
7 pipe(
8 Effect.promise(() => setupOrasBinary()),
9 Effect.tap(() => validateImage(image)),
10 Effect.tap(() => pullImage(image)),
11 Effect.catchAll((error) =>
12 Effect.sync(() => {
13 console.error(`Failed to pull image: ${error.cause}`);
14 Deno.exit(1);
15 })
16 ),
17 ),
18 );
19}