Make the branch argument optional in the shell command, falling back to a plain VM shell when omitted
This commit is contained in:
parent
ef8e40ecb3
commit
de40ddd225
12
src/cli.ts
12
src/cli.ts
|
|
@ -359,9 +359,15 @@ program
|
||||||
|
|
||||||
program
|
program
|
||||||
.command("shell")
|
.command("shell")
|
||||||
.argument("<branch>", "branch name")
|
.argument("[branch]", "branch name (omit for a plain VM shell)")
|
||||||
.description("Open a shell in the VM at the session's worktree")
|
.description("Open a shell in the VM (at the session's worktree if branch given)")
|
||||||
.action(async (branch: string) => {
|
.action(async (branch?: string) => {
|
||||||
|
if (!branch) {
|
||||||
|
await vm.ensure()
|
||||||
|
await vm.shell()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const root = await git.repoRoot()
|
const root = await git.repoRoot()
|
||||||
const session = await state.getSession(root, branch)
|
const session = await state.getSession(root, branch)
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user