From 4a00db207abe4a3e534d3a32ab885cebe1e0cc31 Mon Sep 17 00:00:00 2001 From: Rose Thatcher <97619538+hopefulTex@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:54:14 -0600 Subject: [PATCH] Spin output can still be piped if timeout occurs (#461) --- spin/spin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spin/spin.go b/spin/spin.go index e68e35c..fe4294d 100644 --- a/spin/spin.go +++ b/spin/spin.go @@ -107,6 +107,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case timeout.TickTimeoutMsg: if msg.TimeoutValue <= 0 { + // grab current output before closing for piped instances + m.stdout = outbuf.String() + m.status = exit.StatusAborted return m, tea.Quit }