add dir command to print worktree path for a session
This commit is contained in:
parent
38c767ef29
commit
d5bab69367
17
src/cli.ts
17
src/cli.ts
|
|
@ -399,6 +399,23 @@ program
|
|||
}
|
||||
})
|
||||
|
||||
// ── sandlot dir <branch> ────────────────────────────────────────────
|
||||
|
||||
program
|
||||
.command("dir")
|
||||
.argument("<branch>", "branch name")
|
||||
.description("Print the worktree path for a session")
|
||||
.action(async (branch: string) => {
|
||||
const root = await git.repoRoot()
|
||||
const session = await state.getSession(root, branch)
|
||||
if (!session) {
|
||||
console.error(`No session found for branch "${branch}".`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
process.stdout.write(session.worktree + "\n")
|
||||
})
|
||||
|
||||
// ── sandlot vm ───────────────────────────────────────────────────────
|
||||
|
||||
const vmCmd = program.command("vm").description("Manage the sandlot VM")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user