Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
show loading earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Dec 20, 2016
1 parent d2c4bdd commit bd79284
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Expand Up @@ -42,6 +42,8 @@ func main() {
if token == "" {
return cli.NewExitError("Missing GitHub Token", 1)
}
spin := spin.New("%s Gathering data...")
spin.Start()
user := c.String("user")
filter := c.String("filter")
ts := oauth2.StaticTokenSource(
Expand All @@ -50,17 +52,14 @@ func main() {
tc := oauth2.NewClient(oauth2.NoContext, ts)
client := github.NewClient(tc)
fn := search.Github(client)

if user == "" {
guser, _, err := client.Users.Get("")
if err != nil {
spin.Stop()
return cli.NewExitError(err.Error(), 1)
}
user = *guser.Login
}

spin := spin.New("%s Gathering data...")
spin.Start()
prs, err := karma.Authors(fn, user, filter)
if err != nil {
spin.Stop()
Expand Down

0 comments on commit bd79284

Please sign in to comment.