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
|
||||
.command("shell")
|
||||
.argument("<branch>", "branch name")
|
||||
.description("Open a shell in the VM at the session's worktree")
|
||||
.action(async (branch: string) => {
|
||||
.argument("[branch]", "branch name (omit for a plain VM shell)")
|
||||
.description("Open a shell in the VM (at the session's worktree if branch given)")
|
||||
.action(async (branch?: string) => {
|
||||
if (!branch) {
|
||||
await vm.ensure()
|
||||
await vm.shell()
|
||||
return
|
||||
}
|
||||
|
||||
const root = await git.repoRoot()
|
||||
const session = await state.getSession(root, branch)
|
||||
if (!session) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user