MCPcopy Create free account
hub / github.com/catppuccin/cli / Update

Method Update

internal/ui/progress.go:91–113  ·  view source on GitHub ↗
(msg tea.Msg)

Source from the content-addressed store, hash-verified

89}
90
91func (m ProgressWrapper) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
92 switch msg := msg.(type) {
93 case tea.KeyMsg:
94 return m, tea.Quit // Just quit
95 case progressMsg:
96 var cmds []tea.Cmd
97
98 if msg >= 1.0 {
99 cmds = append(cmds, tea.Sequentially(finalPause(), tea.Quit))
100 }
101
102 cmds = append(cmds, m.progress.SetPercent(float64(msg))) // Set the progress
103 return m, tea.Batch(cmds...)
104 case progress.FrameMsg:
105 // Update bar
106 progressModel, cmd := m.progress.Update(msg)
107 m.progress = progressModel.(progress.Model)
108 return m, cmd
109 case finishMsg:
110 return m, tea.Quit
111 }
112 return m, nil
113}
114
115func (m ProgressWrapper) View() string {
116 return "\nDownloading...\n" +

Callers

nothing calls this directly

Calls 1

finalPauseFunction · 0.85

Tested by

no test coverage detected