StopProgressIndicator stops the progress indicator if it is running. Note that a textual progress indicator does not create a progress indicator, so this method is a no-op in that case.
()
| 362 | // Note that a textual progress indicator does not create a progress indicator, |
| 363 | // so this method is a no-op in that case. |
| 364 | func (s *IOStreams) StopProgressIndicator() { |
| 365 | s.progressIndicatorMu.Lock() |
| 366 | defer s.progressIndicatorMu.Unlock() |
| 367 | if s.progressIndicator == nil { |
| 368 | return |
| 369 | } |
| 370 | s.progressIndicator.Stop() |
| 371 | s.progressIndicator = nil |
| 372 | } |
| 373 | |
| 374 | func (s *IOStreams) RunWithProgress(label string, run func() error) error { |
| 375 | s.StartProgressIndicatorWithLabel(label) |