MCPcopy Create free account
hub / github.com/github/gh-aw / StopWithMessage

Method StopWithMessage

pkg/console/spinner.go:178–201  ·  view source on GitHub ↗
(msg string)

Source from the content-addressed store, hash-verified

176}
177
178func (s *SpinnerWrapper) StopWithMessage(msg string) {
179 if s.enabled && s.program != nil {
180 wasRunning := func() bool {
181 s.mu.Lock()
182 defer s.mu.Unlock()
183 if !s.running {
184 return false
185 }
186 s.running = false
187 return true
188 }()
189 if wasRunning {
190 s.program.Quit()
191 s.wg.Wait() // Wait for the goroutine to complete
192 fmt.Fprintf(os.Stderr, "%s%s%s\n", ansiCarriageReturn, ansiClearLine, msg)
193 } else {
194 // Still print the message even if spinner wasn't running
195 fmt.Fprintf(os.Stderr, "%s\n", msg)
196 }
197 } else if msg != "" {
198 // If spinner is disabled, still print the message for user feedback
199 fmt.Fprintf(os.Stderr, "%s\n", msg)
200 }
201}
202
203func (s *SpinnerWrapper) UpdateMessage(message string) {
204 if s.enabled && s.program != nil {

Callers 12

downloadRunArtifactsFunction · 0.45
SearchServersMethod · 0.45
compileWorkflowMethod · 0.45
cancelWorkflowRunsFunction · 0.45
fetchLatestRunsByRefFunction · 0.45
fetchGitHubWorkflowsFunction · 0.45

Calls 1

WaitMethod · 0.80