commit 4ae9fab33621da6e2515e76cf750087f7d48a71e
parent 91a026c8943c553e358fcd79b538007bbfbc0b4f
Author: Henry Unite <unitehenry@gmail.com>
Date: Sun, 15 Nov 2026 21:11:12 +0000
refactor(context): extract missing Lima message
Move the missing-Lima error message and documentation URL into constants so logging and the thrown error reuse the same string.
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/context/index.ts b/context/index.ts
@@ -5,6 +5,9 @@ import { exec } from "./exec";
import { initLogger, type Logger } from "./logger";
import { initCleanup, type Cleanup } from "./cleanup";
+const LIMA_URL = "https://lima-vm.io/";
+const LIMA_MISSING_MESSAGE = `\`limactl\` is not installed. Lima is required for openpod. See ${LIMA_URL}`;
+
export type OpenpodContext = {
logger: Logger;
openpodRoot: string;
@@ -28,13 +31,8 @@ export async function init(): Promise<OpenpodContext> {
const isLimaInstalled = await isCommandAvailable("limactl");
if (!isLimaInstalled) {
- logger.log(
- "`limactl` is not installed. Lima is required for openpod. See https://lima-vm.io/",
- "error",
- );
- throw new Error(
- "`limactl` is not installed. Lima is required for openpod. See https://lima-vm.io/",
- );
+ logger.log(LIMA_MISSING_MESSAGE, "error");
+ throw new Error(LIMA_MISSING_MESSAGE);
}
return { logger, openpodRoot, cleanup, exec };