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

fix booting from iso

+18 -2
+18 -2
main.ts
··· 23 import rm from "./src/subcommands/rm.ts"; 24 import rmi from "./src/subcommands/rmi.ts"; 25 import run from "./src/subcommands/run.ts"; 26 import start from "./src/subcommands/start.ts"; 27 import stop from "./src/subcommands/stop.ts"; 28 import tag from "./src/subcommands/tag.ts"; ··· 37 type Options, 38 runQemu, 39 } from "./src/utils.ts"; 40 - import serve from "./src/subcommands/serve.ts"; 41 42 export * from "./src/mod.ts"; 43 ··· 128 ) 129 .action(async (options: Options, input?: string) => { 130 const program = Effect.gen(function* () { 131 if (input) { 132 const [image, archivePath] = yield* Effect.all([ 133 getImage(input), ··· 144 }); 145 return; 146 } 147 } 148 - let isoPath: string | null = null; 149 150 151 const config = yield* pipe(
··· 23 import rm from "./src/subcommands/rm.ts"; 24 import rmi from "./src/subcommands/rmi.ts"; 25 import run from "./src/subcommands/run.ts"; 26 + import serve from "./src/subcommands/serve.ts"; 27 import start from "./src/subcommands/start.ts"; 28 import stop from "./src/subcommands/stop.ts"; 29 import tag from "./src/subcommands/tag.ts"; ··· 38 type Options, 39 runQemu, 40 } from "./src/utils.ts"; 41 42 export * from "./src/mod.ts"; 43 ··· 128 ) 129 .action(async (options: Options, input?: string) => { 130 const program = Effect.gen(function* () { 131 + let isoPath: string | null = null; 132 + 133 if (input) { 134 const [image, archivePath] = yield* Effect.all([ 135 getImage(input), ··· 146 }); 147 return; 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 + 164 } 165 166 167 const config = yield* pipe(