use scan()
This commit is contained in:
parent
a397ca6f7d
commit
e9d281b4ca
|
@ -34,6 +34,7 @@ func (r *RepoList) FindRepo(path string) *RepoRow {
|
||||||
return repo
|
return repo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (r *RepoList) AllRepos() []*RepoRow {
|
func (r *RepoList) AllRepos() []*RepoRow {
|
||||||
var all []*RepoRow
|
var all []*RepoRow
|
||||||
for _, repo := range me.allrepos {
|
for _, repo := range me.allrepos {
|
||||||
|
@ -50,6 +51,7 @@ func AllRepos() []*RepoRow {
|
||||||
}
|
}
|
||||||
return all
|
return all
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// a human readable state of the current repo
|
// a human readable state of the current repo
|
||||||
func (r *RepoRow) State() string {
|
func (r *RepoRow) State() string {
|
||||||
|
|
|
@ -116,7 +116,9 @@ func (rl *RepoList) ArgGitPull() bool {
|
||||||
|
|
||||||
log.Log(REPOWARN, "running git pull everywhere")
|
log.Log(REPOWARN, "running git pull everywhere")
|
||||||
var failed int = 0
|
var failed int = 0
|
||||||
for _, repo := range rl.AllRepos() {
|
loop := rl.ReposSortByName()
|
||||||
|
for loop.Scan() {
|
||||||
|
repo := loop.Repo()
|
||||||
if out, err := repo.Status.GitPull(); err == nil {
|
if out, err := repo.Status.GitPull(); err == nil {
|
||||||
log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out)
|
log.Log(REPOWARN, "Ran git pull ok", repo.Status.Path(), out)
|
||||||
} else {
|
} else {
|
||||||
|
@ -142,7 +144,9 @@ func (rl *RepoList) ArgCheckoutDevel() bool {
|
||||||
log.Log(REPOWARN, "running git checkout devel everwhere")
|
log.Log(REPOWARN, "running git checkout devel everwhere")
|
||||||
var failed int = 0
|
var failed int = 0
|
||||||
var count int = 0
|
var count int = 0
|
||||||
for _, repo := range rl.AllRepos() {
|
loop := rl.ReposSortByName()
|
||||||
|
for loop.Scan() {
|
||||||
|
repo := loop.Repo()
|
||||||
count += 1
|
count += 1
|
||||||
if repo.Status.CheckoutDevel() {
|
if repo.Status.CheckoutDevel() {
|
||||||
// checkout ok
|
// checkout ok
|
||||||
|
@ -158,7 +162,9 @@ func (rl *RepoList) ArgCheckoutMaster() bool {
|
||||||
log.Log(REPOWARN, "running git checkout master everwhere")
|
log.Log(REPOWARN, "running git checkout master everwhere")
|
||||||
var failed int = 0
|
var failed int = 0
|
||||||
var count int = 0
|
var count int = 0
|
||||||
for _, repo := range rl.AllRepos() {
|
loop := rl.ReposSortByName()
|
||||||
|
for loop.Scan() {
|
||||||
|
repo := loop.Repo()
|
||||||
count += 1
|
count += 1
|
||||||
if repo.Status.CheckoutMaster() {
|
if repo.Status.CheckoutMaster() {
|
||||||
// checkout ok
|
// checkout ok
|
||||||
|
@ -174,7 +180,9 @@ func (rl *RepoList) ArgCheckoutUser() bool {
|
||||||
log.Log(REPOWARN, "running git checkout master everwhere")
|
log.Log(REPOWARN, "running git checkout master everwhere")
|
||||||
var failed int = 0
|
var failed int = 0
|
||||||
var count int = 0
|
var count int = 0
|
||||||
for _, repo := range rl.AllRepos() {
|
loop := rl.ReposSortByName()
|
||||||
|
for loop.Scan() {
|
||||||
|
repo := loop.Repo()
|
||||||
count += 1
|
count += 1
|
||||||
if repo.Status.CheckoutUser() {
|
if repo.Status.CheckoutUser() {
|
||||||
// checkout ok
|
// checkout ok
|
||||||
|
|
Loading…
Reference in New Issue