+1
src/constants.ts
+1
src/constants.ts
+3
-2
src/utils.ts
+3
-2
src/utils.ts
···
2
2
import { createId } from "@paralleldrive/cuid2";
3
3
import chalk from "chalk";
4
4
import Moniker from "moniker";
5
+
import { EMPTY_DISK_THRESHOLD_KB } from "./constants.ts";
5
6
import { generateRandomMacAddress } from "./network.ts";
6
7
import { saveInstanceState } from "./state.ts";
7
8
···
37
38
}
38
39
39
40
const size = await du(path);
40
-
return size < 10;
41
+
return size < EMPTY_DISK_THRESHOLD_KB;
41
42
}
42
43
43
44
export async function downloadIso(
···
49
50
50
51
if (options.image && await Deno.stat(options.image).catch(() => false)) {
51
52
const driveSize = await du(options.image);
52
-
if (driveSize > 10) {
53
+
if (driveSize > EMPTY_DISK_THRESHOLD_KB) {
53
54
console.log(
54
55
chalk.yellowBright(
55
56
`Drive image ${options.image} is not empty (size: ${driveSize} KB), skipping ISO download to avoid overwriting existing data.`,