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
import rm from "./src/subcommands/rm.ts";
24
import rmi from "./src/subcommands/rmi.ts";
25
import run from "./src/subcommands/run.ts";
0
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* () {
0
0
131
if (input) {
132
const [image, archivePath] = yield* Effect.all([
133
getImage(input),
···
144
});
145
return;
146
}
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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";
0
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
}
0
165
166
167
const config = yield* pipe(