Skip to content

Commit

Permalink
Spin output can still be piped if timeout occurs (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopefulTex authored Dec 13, 2023
1 parent 7b16e87 commit 4a00db2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spin/spin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4a00db2

Please sign in to comment.