Move helper to iostreams
This commit is contained in:
parent
5879923b4f
commit
43783a33a2
2 changed files with 8 additions and 4 deletions
|
|
@ -57,10 +57,7 @@ func (a *App) StopProgressIndicator() {
|
|||
}
|
||||
|
||||
func (a *App) RunWithProgress(label string, f func() error) error {
|
||||
a.StartProgressIndicatorWithLabel(label)
|
||||
defer a.StopProgressIndicator()
|
||||
|
||||
return f()
|
||||
return a.io.RunWithProgress(label, f)
|
||||
}
|
||||
|
||||
// Connects to a codespace using Live Share and returns that session
|
||||
|
|
|
|||
|
|
@ -305,6 +305,13 @@ func (s *IOStreams) StopProgressIndicator() {
|
|||
s.progressIndicator = nil
|
||||
}
|
||||
|
||||
func (s *IOStreams) RunWithProgress(label string, f func() error) error {
|
||||
s.StartProgressIndicatorWithLabel(label)
|
||||
defer s.StopProgressIndicator()
|
||||
|
||||
return f()
|
||||
}
|
||||
|
||||
func (s *IOStreams) StartAlternateScreenBuffer() {
|
||||
if s.alternateScreenBufferEnabled {
|
||||
s.alternateScreenBufferMu.Lock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue