summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-01 00:47:04 -0600
committerJeff Carr <[email protected]>2024-12-01 00:47:04 -0600
commita483e69d12f9522e882b700d3ea6940a6fd86bff (patch)
treeb19c17eb860253f7d21b6e7dfb650e119ee15352
parent58a05460c7c295980d5d7be38df0aeae1ccd88fa (diff)
misc cleanupsv0.6.8
-rw-r--r--control6
-rw-r--r--main.go14
-rw-r--r--readWorkFile.go41
3 files changed, 15 insertions, 46 deletions
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 <[email protected]>
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
-}
-*/