summaryrefslogtreecommitdiff
path: root/findRepos.go
blob: 1463d09797f41c7a73a393eb389ce77943285041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main

import (
	"go.wit.com/log"
)

func findRepos() {
	if argv.FindAll {
		var configsave bool
		repos := me.forge.Repos.SortByGoPath()
		for repos.Scan() {
			repo := repos.Next()
			if me.forge.Config.IsReadOnly(repo.GoPath) && !argv.FindReadOnly {
				if repo.ReadOnly {
					continue
				}
				log.Info("todo: ConfigSave() readonly flag on repo is wrong", repo.GoPath)
				repo.ReadOnly = true
				configsave = true
				continue
			}
			me.found.AppendUniqueGoPath(repo)
		}
		if configsave {
			log.Info("should ConfigSave here")
			me.forge.Repos.ConfigSave()
		}
	}

	if argv.FindPrivate {
		findPrivate()
	}

	if argv.FindMine {
		findMine()
	}
	if argv.FindFavorites {
		findFavorites()
	}
}