tangled
alpha
login
or
join now
tsiry-sandratraina.com
/
vmx
1
fork
atom
A Docker-like CLI and HTTP API for managing headless VMs
1
fork
atom
overview
issues
pulls
pipelines
fix booting from iso
tsiry-sandratraina.com
3 months ago
d1660bdb
83a011ba
+18
-2
1 changed file
expand all
collapse all
unified
split
main.ts
+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
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
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
131
+
let isoPath: string | null = null;
132
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
149
+
150
150
+
if (isValidISOurl(input)) {
151
151
+
isoPath = yield* downloadIso(input, options);
152
152
+
}
153
153
+
154
154
+
if (yield* pipe(
155
155
+
fileExists(input),
156
156
+
Effect.map(() => true),
157
157
+
Effect.catchAll(() => Effect.succeed(false)))
158
158
+
) {
159
159
+
if (input.endsWith(".iso")) {
160
160
+
isoPath = input;
161
161
+
}
162
162
+
}
163
163
+
147
164
}
148
148
-
let isoPath: string | null = null;
149
165
150
166
151
167
const config = yield* pipe(