summaryrefslogtreecommitdiff
path: root/validate
diff options
context:
space:
mode:
Diffstat (limited to 'validate')
-rw-r--r--validate/Makefile2
-rw-r--r--validate/argv.go7
-rw-r--r--validate/main.go29
3 files changed, 24 insertions, 14 deletions
diff --git a/validate/Makefile b/validate/Makefile
index 24a62b6..c287e2e 100644
--- a/validate/Makefile
+++ b/validate/Makefile
@@ -5,7 +5,7 @@ build:
reset
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
- ./validate
+ ./validate --repo go.wit.com/apps/wit-package
goimports:
goimports -w *.go
diff --git a/validate/argv.go b/validate/argv.go
index c46149b..35dd9a9 100644
--- a/validate/argv.go
+++ b/validate/argv.go
@@ -9,9 +9,10 @@ import (
var argv args
type args struct {
- List bool `arg:"--list" default:"false" help:"list repos in your config"`
- SaveConfig bool `arg:"--save" default:"false" help:"save your config file at the end"`
- Interesting bool `arg:"--interesting" default:"false" help:"something you decided was cool"`
+ Repo string `arg:"--repo" help:"repo to check"`
+ List bool `arg:"--list" default:"false" help:"list repos in your config"`
+ SaveConfig bool `arg:"--save" default:"false" help:"save your config file at the end"`
+ Interesting bool `arg:"--interesting" default:"false" help:"something you decided was cool"`
}
func (a args) Description() string {
diff --git a/validate/main.go b/validate/main.go
index 57329ef..7c32ac6 100644
--- a/validate/main.go
+++ b/validate/main.go
@@ -35,6 +35,9 @@ func main() {
repos := forge.Repos.SortByGoPath()
for repos.Scan() {
repo := repos.Next()
+ if ! repo.IsValid() {
+ continue
+ }
// forge.VerifyBranchNames(repo)
fullpath := repo.GetFullPath()
mName := repo.GetMasterBranchName()
@@ -44,16 +47,16 @@ func main() {
plen := repo.PublishedLen()
var ds, ps string
if dlen == 0 {
- ds = ""
+ ds = " "
} else {
ds = fmt.Sprintf("%2d", dlen)
}
if plen == 0 {
- ps = ""
+ ps = " "
} else {
ps = fmt.Sprintf("%2d", plen)
}
- log.Printf("repo: %-60s %-10s %-8s %-8s %s %s\n", fullpath, mName, dName, uName, ds, ps)
+ log.Printf("repo: %-60s %-10s %-8s %-8s %s %s %s\n", fullpath, mName, dName, uName, ds, ps, repo.RepoType())
/*
if repo.GoDepsChanged() {
log.Printf("\tdependancy checks indicate a new release is needed for %s\n", repo.GetGoPath())
@@ -63,21 +66,27 @@ func main() {
*/
}
- goclone := forge.Repos.FindByGoPath("go.wit.com/apps/go-clone")
- if goclone == nil {
- log.Info("boo, you didn't git go-clone?")
+ if argv.Repo == "" {
+ log.Info("no --repo")
+ os.Exit(-1)
+ }
+
+ check := forge.Repos.FindByGoPath(argv.Repo)
+ if check == nil {
+ log.Info("boo, you didn't git check", argv.Repo)
os.Exit(-1)
}
+ check.RedoGoMod()
- match, err := forge.Repos.GoDepsChanged(goclone)
+ match, err := forge.Repos.GoDepsChanged(check)
if err != nil {
- log.Info("dependancy checks failed", goclone.GetGoPath(), err)
+ log.Info("dependancy checks failed", check.GetGoPath(), err)
os.Exit(-1)
}
if match {
- log.Printf("dependancy checks indicate a new release is needed for %s\n", goclone.GetGoPath())
+ log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
} else {
- log.Printf("dependancies have not changed for %s\n", goclone.GetGoPath())
+ log.Printf("dependancies have not changed for %s\n", check.GetGoPath())
}
if argv.SaveConfig {