Show progress while creating pr

This commit is contained in:
Karel Coudijzer 2021-01-19 21:29:24 +01:00
parent b5366c6ebf
commit a7b9e3916c

View file

@ -577,7 +577,9 @@ func submitPR(opts CreateOptions, ctx CreateContext, state shared.IssueMetadataS
return err
}
opts.IO.StartProgressIndicator()
pr, err := api.CreatePullRequest(client, ctx.BaseRepo.(*api.Repository), params)
opts.IO.StopProgressIndicator()
if pr != nil {
fmt.Fprintln(opts.IO.Out, pr.URL)
}
@ -613,7 +615,9 @@ func handlePush(opts CreateOptions, ctx CreateContext) error {
// if a head repository could not be determined so far, automatically create
// one by forking the base repository
if headRepo == nil && ctx.IsPushEnabled {
opts.IO.StartProgressIndicator()
headRepo, err = api.ForkRepo(client, ctx.BaseRepo)
opts.IO.StopProgressIndicator()
if err != nil {
return fmt.Errorf("error forking repo: %w", err)
}
@ -677,7 +681,9 @@ func handlePush(opts CreateOptions, ctx CreateContext) error {
return nil
}
opts.IO.StartProgressIndicator()
err := pushBranch()
opts.IO.StopProgressIndicator()
if err != nil {
return err
}