Skip to content

Commit

Permalink
update the spinner functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
knbr13 committed Feb 1, 2024
1 parent 4bba062 commit cf6feeb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ func main() {
reader := bufio.NewReader(os.Stdin)
folder := getPathFromUser(reader)

s := spinner.New(spinner.CharSets[11], 100*time.Millisecond, spinner.WithSuffix(" loading..."))
s := spinner.New(spinner.CharSets[6], 100*time.Millisecond, spinner.WithSuffix(" loading..."))

s.Color("red", "bold")
s.Color("green")
s.Start()
defer s.Stop()

repos, err := scanGitFolders(folder)
if err != nil {
fmt.Fprint(os.Stderr, color.Red.Sprintf("Error: %v\n", err))
fmt.Fprint(os.Stderr, color.Red.Sprintf("\nerror: %s\n", err.Error()))
s.Stop()
os.Exit(1)
}
stats(email, repos)

commits := processRepos(repos, email)
fmt.Print("\n\n")
printTable(commits)
fmt.Print("\n\n")
}

0 comments on commit cf6feeb

Please sign in to comment.