A Docker-like CLI and HTTP API for managing headless VMs

fix booting from iso

+18 -2
+18 -2
main.ts
··· 23 23 import rm from "./src/subcommands/rm.ts"; 24 24 import rmi from "./src/subcommands/rmi.ts"; 25 25 import run from "./src/subcommands/run.ts"; 26 + import serve from "./src/subcommands/serve.ts"; 26 27 import start from "./src/subcommands/start.ts"; 27 28 import stop from "./src/subcommands/stop.ts"; 28 29 import tag from "./src/subcommands/tag.ts"; ··· 37 38 type Options, 38 39 runQemu, 39 40 } from "./src/utils.ts"; 40 - import serve from "./src/subcommands/serve.ts"; 41 41 42 42 export * from "./src/mod.ts"; 43 43 ··· 128 128 ) 129 129 .action(async (options: Options, input?: string) => { 130 130 const program = Effect.gen(function* () { 131 + let isoPath: string | null = null; 132 + 131 133 if (input) { 132 134 const [image, archivePath] = yield* Effect.all([ 133 135 getImage(input), ··· 144 146 }); 145 147 return; 146 148 } 149 + 150 + if (isValidISOurl(input)) { 151 + isoPath = yield* downloadIso(input, options); 152 + } 153 + 154 + if (yield* pipe( 155 + fileExists(input), 156 + Effect.map(() => true), 157 + Effect.catchAll(() => Effect.succeed(false))) 158 + ) { 159 + if (input.endsWith(".iso")) { 160 + isoPath = input; 161 + } 162 + } 163 + 147 164 } 148 - let isoPath: string | null = null; 149 165 150 166 151 167 const config = yield* pipe(