feat: allign bar prefix update with progress increase
This commit is contained in:
parent
b368b46847
commit
a95389f25d
1 changed files with 4 additions and 4 deletions
|
|
@ -57,7 +57,6 @@ func checkoutRepositories(repositories []Repository, concurrency int) {
|
||||||
// update the progress bar
|
// update the progress bar
|
||||||
descriptionPrefixPre := "Cloning repository "
|
descriptionPrefixPre := "Cloning repository "
|
||||||
descriptionPrefix := descriptionPrefixPre + repoName + " ..."
|
descriptionPrefix := descriptionPrefixPre + repoName + " ..."
|
||||||
bar.Describe(descriptionPrefix)
|
|
||||||
|
|
||||||
// clone the repo
|
// clone the repo
|
||||||
cloneRepository := func(repoDestination string, url string) (string, error) {
|
cloneRepository := func(repoDestination string, url string) (string, error) {
|
||||||
|
|
@ -74,8 +73,9 @@ func checkoutRepositories(repositories []Repository, concurrency int) {
|
||||||
// set a lock, increment counters and unlock
|
// set a lock, increment counters and unlock
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
clonedCount++
|
clonedCount++
|
||||||
mu.Unlock()
|
bar.Describe(descriptionPrefix)
|
||||||
progressBarAdd(1)
|
progressBarAdd(1)
|
||||||
|
mu.Unlock()
|
||||||
|
|
||||||
// pull the latest
|
// pull the latest
|
||||||
case strings.Contains(string(repoStatus), url):
|
case strings.Contains(string(repoStatus), url):
|
||||||
|
|
@ -89,8 +89,8 @@ func checkoutRepositories(repositories []Repository, concurrency int) {
|
||||||
// set a lock, increment counters and unlock
|
// set a lock, increment counters and unlock
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
errorCount++
|
errorCount++
|
||||||
mu.Unlock()
|
|
||||||
progressBarAdd(1)
|
progressBarAdd(1)
|
||||||
|
mu.Unlock()
|
||||||
}
|
}
|
||||||
}(repo)
|
}(repo)
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +104,6 @@ func pullRepository(repoName string, repoDestination string) {
|
||||||
// update the progress bar
|
// update the progress bar
|
||||||
descriptionPrefixPre := "Pulling repository "
|
descriptionPrefixPre := "Pulling repository "
|
||||||
descriptionPrefix := descriptionPrefixPre + repoName + " ..."
|
descriptionPrefix := descriptionPrefixPre + repoName + " ..."
|
||||||
bar.Describe(descriptionPrefix)
|
|
||||||
|
|
||||||
// find remote
|
// find remote
|
||||||
findRemote := func(repoDestination string) (string, error) {
|
findRemote := func(repoDestination string) (string, error) {
|
||||||
|
|
@ -125,6 +124,7 @@ func pullRepository(repoName string, repoDestination string) {
|
||||||
|
|
||||||
// set a lock, increment counters and unlock
|
// set a lock, increment counters and unlock
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
|
bar.Describe(descriptionPrefix)
|
||||||
pulledCount++
|
pulledCount++
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue