close not rm
This commit is contained in:
parent
f27eccf5b0
commit
19a1d0c563
21
src/cli.ts
21
src/cli.ts
|
|
@ -96,13 +96,9 @@ program
|
|||
await vm.claude(join(root, session.worktree))
|
||||
})
|
||||
|
||||
// ── sandlot rm <branch> ──────────────────────────────────────────────
|
||||
// ── sandlot close <branch> ───────────────────────────────────────────
|
||||
|
||||
program
|
||||
.command("rm")
|
||||
.argument("<branch>", "branch name")
|
||||
.description("Remove a worktree and clean up the session")
|
||||
.action(async (branch: string) => {
|
||||
const closeAction = async (branch: string) => {
|
||||
const root = await git.repoRoot()
|
||||
const session = await state.getSession(root, branch)
|
||||
const worktreeRel = session?.worktree ?? `.sandlot/${branch}`
|
||||
|
|
@ -117,7 +113,18 @@ program
|
|||
if (session) {
|
||||
await state.removeSession(root, branch)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
program
|
||||
.command("close")
|
||||
.argument("<branch>", "branch name")
|
||||
.description("Remove a worktree and clean up the session")
|
||||
.action(closeAction)
|
||||
|
||||
program
|
||||
.command("rm", { hidden: true })
|
||||
.argument("<branch>", "branch name")
|
||||
.action(closeAction)
|
||||
|
||||
// ── sandlot vm ───────────────────────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user