misc cleanups
This commit is contained in:
parent
58a05460c7
commit
a483e69d12
6
control
6
control
|
@ -1,10 +1,8 @@
|
||||||
Source: go-clone
|
Source: go-clone
|
||||||
Build-Depends: golang
|
Build-Depends: golang, protoc-gen-go, autogenpb
|
||||||
Package: go-clone
|
Package: go-clone
|
||||||
Maintainer: Jeff Carr <jcarr@wit.com>
|
Maintainer: Jeff Carr <jcarr@wit.com>
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Depends:
|
Depends:
|
||||||
Recommends: go-clone
|
Recommends: go-clone
|
||||||
Description: git clones a go package and it's dependancies
|
Description: 'git clone' the sources for a go project
|
||||||
does GO111MODULE=auto go get -v (more or less) only works on git
|
|
||||||
repositories. This is an experiment. GO should be used instead.
|
|
||||||
|
|
14
main.go
14
main.go
|
@ -37,9 +37,19 @@ func main() {
|
||||||
// load the ~/.config/forge/ config
|
// load the ~/.config/forge/ config
|
||||||
// this lets you configure repos you have read/write access too
|
// this lets you configure repos you have read/write access too
|
||||||
forge = forgepb.Init()
|
forge = forgepb.Init()
|
||||||
forge.ConfigPrintTable()
|
// forge.ConfigPrintTable()
|
||||||
os.Setenv("REPO_WORK_PATH", forge.GetGoSrc())
|
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
|
// gui is in testing
|
||||||
myGui := gui.New()
|
myGui := gui.New()
|
||||||
// myGui.Default()
|
// myGui.Default()
|
||||||
|
@ -191,6 +201,8 @@ func redoGoModAll() {
|
||||||
func build() {
|
func build() {
|
||||||
if argv.Build {
|
if argv.Build {
|
||||||
log.Info("need to try to build here")
|
log.Info("need to try to build here")
|
||||||
|
} else {
|
||||||
|
log.Info("skipping build")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
*/
|
|
Loading…
Reference in New Issue