Use spinner helper
This commit is contained in:
parent
b2edf782cf
commit
efc05dee90
1 changed files with 2 additions and 11 deletions
|
|
@ -8,7 +8,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/MakeNowJust/heredoc"
|
||||
"github.com/briandowns/spinner"
|
||||
"github.com/cli/cli/api"
|
||||
"github.com/cli/cli/internal/config"
|
||||
"github.com/cli/cli/internal/ghrepo"
|
||||
|
|
@ -93,21 +92,13 @@ func viewRun(opts *ViewOptions) error {
|
|||
}
|
||||
|
||||
if opts.Comments {
|
||||
var s *spinner.Spinner
|
||||
if opts.IO.IsStdoutTTY() {
|
||||
s = utils.Spinner(opts.IO.ErrOut)
|
||||
utils.StartSpinner(s)
|
||||
}
|
||||
|
||||
opts.IO.StartProgressIndicator()
|
||||
comments, err := api.CommentsForIssue(apiClient, repo, issue)
|
||||
opts.IO.StopProgressIndicator()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
issue.Comments = *comments
|
||||
|
||||
if opts.IO.IsStdoutTTY() {
|
||||
utils.StopSpinner(s)
|
||||
}
|
||||
}
|
||||
|
||||
opts.IO.DetectTerminalTheme()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue