A spec for --source, and for --repos-from none with no --source
Misha Kaletsky, 2026-11-25 14:17 UTC · 01edef9e3c6752c40152c5851f6df29f20792cd5 · parent f2093f0
2 files changed
M core/lib/src/cli/deploy.test.ts
@@ -30,6 +30,7 @@ identityKeyLineOf, isColorEnabled, isInteractiveEnv, + kernelCheckout, kernelOriginOf, mindConfigIn, onboardingUrlOf, @@ -176,6 +177,17 @@ // the mind that hosts the source has no mind to take a kernel from: it is deployed with --source expect(kernelOriginOf("none")).toBeNull(); expect(() => kernelOriginOf("somewhere")).toThrow("--repos-from somewhere is no address"); +}); + +test("--source deploys a checkout on this computer as it is, and with --repos-from none and no --source there is no kernel to deploy", async () => { + const dir = mkdtempSync(join(tmpdir(), "deploy-")); + expect(await kernelCheckout({ source: dir, reposFrom: "none" })).toEqual({ + dir, + from: `the checkout ${dir}`, + }); + await expect(kernelCheckout({ reposFrom: "none" })).rejects.toThrow( + "--repos-from none names no mind to take the kernel from: give a checkout of the kernel with --source.", + ); }); test("the kernel is fetched at the branch asked for into a folder that is kept, and the deploy learns which commit it holds", async () => {
M core/lib/src/cli/deploy.ts
@@ -1023,7 +1023,7 @@ * holds. `--source` names a checkout instead, which is how someone who works on the kernel * deploys what is on their disk, and how the mind that hosts the source is deployed. The folder * this command happens to run in is never the kernel by itself. */ -async function kernelCheckout(input: DeployInput) { +export async function kernelCheckout(input: DeployInput) { if (input.source) { const dir = resolve(input.source); return { dir, from: `the checkout ${dir}` };