From 8e62ce1a59b98b47d1b7c350e39542bde7524a6d Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Tue, 24 Feb 2026 09:52:11 -0800 Subject: [PATCH] Normalize ~/Code path to lowercase ~/code --- src/vm.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vm.ts b/src/vm.ts index 7310736..3ce4f7c 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -18,8 +18,8 @@ export function containerPath(hostPath: string): string { if (hostPath.startsWith(`${home}/dev`)) { return "/host/dev" + hostPath.slice(`${home}/dev`.length) } - if (hostPath.startsWith(`${home}/Code`)) { - return "/host/Code" + hostPath.slice(`${home}/Code`.length) + if (hostPath.startsWith(`${home}/code`)) { + return "/host/code" + hostPath.slice(`${home}/code`.length) } return hostPath } @@ -48,7 +48,7 @@ async function run(cmd: ReturnType, step: string): Promise { async function hostMounts(home: string): Promise<{ dev: boolean; code: boolean }> { const [dev, code] = await Promise.all([ Bun.file(`${home}/dev`).exists().catch(() => false), - Bun.file(`${home}/Code`).exists().catch(() => false), + Bun.file(`${home}/code`).exists().catch(() => false), ]) return { dev, code } } @@ -58,7 +58,7 @@ async function createContainer(home: string): Promise { const mounts = await hostMounts(home) const args = ["container", "run", "-d", "--name", CONTAINER_NAME, "-m", "4G"] if (mounts.dev) args.push("--mount", `type=bind,source=${home}/dev,target=/host/dev,readonly`) - if (mounts.code) args.push("--mount", `type=bind,source=${home}/Code,target=/host/Code,readonly`) + if (mounts.code) args.push("--mount", `type=bind,source=${home}/code,target=/host/code,readonly`) args.push("-v", `${home}/.sandlot:/sandlot`, "ubuntu:24.04", "sleep", "infinity") const result = await $`${args}`.nothrow().quiet() if (result.exitCode !== 0) { @@ -83,7 +83,7 @@ async function createHostSymlinks(home: string): Promise { const mounts = await hostMounts(home) const cmds = [`mkdir -p '${home}'`, `ln -s /sandlot '${home}/.sandlot'`] if (mounts.dev) cmds.push(`ln -s /host/dev '${home}/dev'`) - if (mounts.code) cmds.push(`ln -s /host/Code '${home}/Code'`) + if (mounts.code) cmds.push(`ln -s /host/code '${home}/code'`) await run( $`container exec ${CONTAINER_NAME} bash -c ${cmds.join(" && ")}`, "Symlink creation") @@ -270,7 +270,7 @@ export async function claude(workdir: string, opts?: { prompt?: string; print?: `Your working directory is ${cwd}, a git worktree managed by sandlot.`, ] if (mounts.dev) systemPromptLines.push("The host's ~/dev is mounted read-only at /host/dev.") - if (mounts.code) systemPromptLines.push("The host's ~/Code is mounted read-only at /host/Code.") + if (mounts.code) systemPromptLines.push("The host's ~/code is mounted read-only at /host/code.") systemPromptLines.push( "The host's ~/.sandlot is mounted at /sandlot.", "Bun is installed at ~/.local/bin/bun. Use bun instead of node/npm.",