forked from Gitlink/gitlink-cli
Selecting a command showed no output because Execute built the
RuntimeContext as a bare struct literal (&RuntimeContext{Args: args}),
leaving Client == nil. Any command calling ctx.CallAPI then panicked with
a nil pointer dereference inside the executor goroutine; the panic aborted
the goroutine before w.Close()/stdout restore, so the execResultMsg never
fired and the REPL hung silently.
Fix: use common.NewRuntimeContext(args) (initializes Client/Format/Owner/Repo,
matching runner.go), and wrap s.Run in safeRun() so a panic converts to an
error and stdout is always restored.
Adds regression tests: nil-Client assertion, panic-safe stdout restore, and
an end-to-end test that runs the real repo +list shortcut and asserts
Execute never returns (empty output, nil error).
|
||
|---|---|---|
| .. | ||
| e2e_command_test.go | ||
| executor.go | ||
| executor_runtime_test.go | ||
| executor_test.go | ||
| form.go | ||
| interactive.go | ||
| palette.go | ||
| repl.go | ||
| repl_trigger_test.go | ||