Add generic progress runner

This commit is contained in:
JP Ungaretti 2023-01-12 22:56:19 +00:00
parent efe57991b0
commit 216d3bf912

View file

@ -56,6 +56,13 @@ func (a *App) StopProgressIndicator() {
a.io.StopProgressIndicator()
}
func (a *App) RunWithProgress(label string, f func() error) error {
a.StartProgressIndicatorWithLabel(label)
defer a.StopProgressIndicator()
return f()
}
// Connects to a codespace using Live Share and returns that session
func startLiveShareSession(ctx context.Context, codespace *api.Codespace, a *App, debug bool, debugFile string) (session *liveshare.Session, err error) {
liveshareLogger := noopLogger()