diff --git a/control b/control index 691820d..23fa487 100644 --- a/control +++ b/control @@ -1,10 +1,8 @@ Source: go-clone -Build-Depends: golang +Build-Depends: golang, protoc-gen-go, autogenpb Package: go-clone Maintainer: Jeff Carr Architecture: amd64 Depends: Recommends: go-clone -Description: git clones a go package and it's dependancies - does GO111MODULE=auto go get -v (more or less) only works on git - repositories. This is an experiment. GO should be used instead. +Description: 'git clone' the sources for a go project diff --git a/main.go b/main.go index ccab7df..dca3832 100644 --- a/main.go +++ b/main.go @@ -37,9 +37,19 @@ func main() { // load the ~/.config/forge/ config // this lets you configure repos you have read/write access too forge = forgepb.Init() - forge.ConfigPrintTable() + // forge.ConfigPrintTable() os.Setenv("REPO_WORK_PATH", forge.GetGoSrc()) + pb := forge.Repos.FindByGoPath(argv.Repo) + if pb == nil { + log.Info("yep, need to clone", argv.Repo) + } else { + log.Info("already have", argv.Repo) + build() + okExit(argv.Repo) + } + + // gui is in testing myGui := gui.New() // myGui.Default() @@ -191,6 +201,8 @@ func redoGoModAll() { func build() { if argv.Build { log.Info("need to try to build here") + } else { + log.Info("skipping build") } } diff --git a/readWorkFile.go b/readWorkFile.go deleted file mode 100644 index dc36754..0000000 --- a/readWorkFile.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -/* -func addDir(d string) { - if shell.IsDir(d) { - rv.NewRepo(d) - } -} - -func readControlFile(path string) error { - fullname := filepath.Join(path, "go.work") - file, err := os.Open(fullname) - if err != nil { - return err - } - defer file.Close() - - // pairs := make(map[string]string) - // var key string - - scanner := bufio.NewScanner(file) - for scanner.Scan() { - line := scanner.Text() - - line = strings.TrimSpace(line) - - partsNew := strings.SplitN(line, ":", 2) - if len(partsNew) > 1 { - continue - } - log.Info(line) - addDir(line) - } - - if err := scanner.Err(); err != nil { - return err - } - - return nil -} -*/