feat: improved bar prefix depending on repo count
This commit is contained in:
parent
f7be880078
commit
0de1461fc3
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
|
@ -178,6 +178,11 @@ func checkoutRepositories(repositories []Repository) {
|
||||||
// make progressbar using:
|
// make progressbar using:
|
||||||
// - github.com/k0kubun/go-ansi
|
// - github.com/k0kubun/go-ansi
|
||||||
// - github.com/schollz/progressbar/v3
|
// - github.com/schollz/progressbar/v3
|
||||||
|
barPrefix := fmt.Sprintf("Getting your one and only repository...")
|
||||||
|
if repoCount > 1 {
|
||||||
|
barPrefix = fmt.Sprintf("Getting your repositories...")
|
||||||
|
}
|
||||||
|
|
||||||
bar := progressbar.NewOptions(
|
bar := progressbar.NewOptions(
|
||||||
repoCount,
|
repoCount,
|
||||||
progressbar.OptionSetWriter(ansi.NewAnsiStdout()),
|
progressbar.OptionSetWriter(ansi.NewAnsiStdout()),
|
||||||
|
|
@ -186,7 +191,7 @@ func checkoutRepositories(repositories []Repository) {
|
||||||
progressbar.OptionSetElapsedTime(true),
|
progressbar.OptionSetElapsedTime(true),
|
||||||
progressbar.OptionSetPredictTime(false),
|
progressbar.OptionSetPredictTime(false),
|
||||||
progressbar.OptionSetWidth(20),
|
progressbar.OptionSetWidth(20),
|
||||||
progressbar.OptionSetDescription("Getting your repositories..."),
|
progressbar.OptionSetDescription(barPrefix),
|
||||||
progressbar.OptionSetTheme(progressbar.Theme{
|
progressbar.OptionSetTheme(progressbar.Theme{
|
||||||
Saucer: "[green]=[reset]",
|
Saucer: "[green]=[reset]",
|
||||||
SaucerHead: "[green]>[reset]",
|
SaucerHead: "[green]>[reset]",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue