3030 MultiTaskMsgWaitingStyle = MultiTaskMsgSuccessStyle .Copy ().
3131 Foreground (lipgloss.AdaptiveColor {Light : "#2B53AF" , Dark : "#37B9FF" })
3232
33+ MultiTaskMsgWarningStyle = MultiTaskMsgSuccessStyle .Copy ().
34+ Foreground (lipgloss.AdaptiveColor {Light : "#FF9A0D" , Dark : "#F8CA61" })
35+
3336 MultiTaskSpinner = spinner.Model {
3437 Style : lipgloss .NewStyle ().Foreground (lipgloss.AdaptiveColor {Light : "#FF9A0D" , Dark : "#F8CA61" }),
3538 Spinner : spinner.Spinner {
@@ -67,6 +70,14 @@ type Task struct {
6770 err error
6871}
6972
73+ type WarnErr struct {
74+ Message string
75+ }
76+
77+ func (e WarnErr ) Error () string {
78+ return e .Message
79+ }
80+
7081type MultiTaskModel struct {
7182 Tasks []Task
7283 Spinner spinner.Model
@@ -77,6 +88,7 @@ type MultiTaskModel struct {
7788 MsgSuccessStyle lipgloss.Style
7889 MsgFailedStyle lipgloss.Style
7990 MsgWaitingStyle lipgloss.Style
91+ MsgWarningStyle lipgloss.Style
8092
8193 index int
8294}
@@ -95,6 +107,7 @@ func NewMultiTaskModelWithTasks(tasks []Task) MultiTaskModel {
95107 MsgSuccessStyle : MultiTaskMsgSuccessStyle ,
96108 MsgFailedStyle : MultiTaskMsgFailedStyle ,
97109 MsgWaitingStyle : MultiTaskMsgWaitingStyle ,
110+ MsgWarningStyle : MultiTaskMsgWarningStyle ,
98111 }
99112}
100113
@@ -119,7 +132,9 @@ func (m MultiTaskModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
119132 }
120133 case TaskDoneMsg :
121134 if m .Tasks [m .index ].err != nil {
122- return m , tea .Quit
135+ if _ , ok := m .Tasks [m .index ].err .(WarnErr ); ! ok {
136+ return m , tea .Quit
137+ }
123138 }
124139
125140 m .index ++
@@ -147,7 +162,11 @@ func (m MultiTaskModel) View() string {
147162 view = lipgloss .JoinVertical (lipgloss .Left , view , m .Spinner .View ()+ " " + m .MsgWaitingStyle .Render (task .Title ))
148163 }
149164 } else {
150- view = lipgloss .JoinVertical (lipgloss .Left , view , m .MsgFailedStyle .Render ("[ ✗ ] " + task .err .Error ()))
165+ if _ , ok := task .err .(WarnErr ); ok {
166+ view = lipgloss .JoinVertical (lipgloss .Left , view , m .MsgWarningStyle .Render ("[ ≡ ] " + task .err .Error ()))
167+ } else {
168+ view = lipgloss .JoinVertical (lipgloss .Left , view , m .MsgFailedStyle .Render ("[ ✗ ] " + task .err .Error ()))
169+ }
151170 }
152171
153172 }
0 commit comments