fix spinner lifecycle to reuse single spinner instance and suppress "Session ready" in print mode
This commit is contained in:
parent
b4b5a11a90
commit
e4bee9c7c8
|
|
@ -115,7 +115,7 @@ program
|
|||
|
||||
spin.text = "Starting container"
|
||||
await vm.ensure((msg) => { spin.text = msg })
|
||||
spin.succeed("Session ready")
|
||||
if (!opts.print) spin.succeed("Session ready")
|
||||
} catch (err) {
|
||||
spin.fail(String((err as Error).message ?? err))
|
||||
await git.removeWorktree(worktreeAbs, root).catch(() => {})
|
||||
|
|
@ -131,7 +131,7 @@ program
|
|||
})
|
||||
|
||||
if (opts.print) {
|
||||
const spin = spinner("Running prompt…")
|
||||
spin.text = "Running prompt…"
|
||||
await vm.claude(worktreeAbs, { prompt, print: opts.print })
|
||||
process.stdout.write("\n")
|
||||
spin.succeed("Prompt complete")
|
||||
|
|
@ -189,14 +189,14 @@ program
|
|||
|
||||
const spin = spinner("Starting container")
|
||||
await vm.ensure((msg) => { spin.text = msg })
|
||||
spin.succeed("Session ready")
|
||||
|
||||
if (opts.print) {
|
||||
const spin = spinner("Running prompt…")
|
||||
spin.text = "Running prompt…"
|
||||
await vm.claude(session.worktree, { prompt, print: opts.print })
|
||||
process.stdout.write("\n")
|
||||
spin.succeed("Prompt complete")
|
||||
} else {
|
||||
spin.succeed("Session ready")
|
||||
await vm.claude(session.worktree, { prompt, print: opts.print })
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user