summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-26 14:21:05 -0600
committerJeff Carr <[email protected]>2024-01-26 14:21:05 -0600
commit3388a2dc2c0560278a01e14abe53dc30bfecaee3 (patch)
treeb9655c42d954aa47dc2ec9661ccbae509cadf666
parent0e979faf5b6ef2d8b37fd63835824bf5405cbc08 (diff)
disable already downloaded repos
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--globalBuildOptions.go12
-rw-r--r--listWindow.go9
-rw-r--r--structs.go6
3 files changed, 25 insertions, 2 deletions
diff --git a/globalBuildOptions.go b/globalBuildOptions.go
index ccf6b0b..8257da6 100644
--- a/globalBuildOptions.go
+++ b/globalBuildOptions.go
@@ -3,6 +3,7 @@ package main
import (
"os"
+ "path/filepath"
"go.wit.com/log"
@@ -93,6 +94,17 @@ func globalBuildOptions(box *gui.Node) {
newBranch.SetText("jcarr")
me.autoWorkingPwd = gadgets.NewOneLiner(grid, "working directory (pwd)")
+ me.userHomePwd = gadgets.NewOneLiner(grid, "user home")
+ me.goSrcPwd = gadgets.NewOneLiner(grid, "go src home")
+
+ homeDir, err := os.UserHomeDir()
+ if err != nil {
+ log.Warn("Error getting home directory:", err)
+ homeDir = "/home/autotypist"
+ }
+ me.userHomePwd.SetText(homeDir)
+ srcDir := filepath.Join(homeDir, "go/src")
+ me.goSrcPwd.SetText(srcDir)
group2 := vbox.NewGroup("Run in every git repository")
me.stopOnErrors = group2.NewCheckbox("Stop on errors")
diff --git a/listWindow.go b/listWindow.go
index c883bd2..1819b96 100644
--- a/listWindow.go
+++ b/listWindow.go
@@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"os"
+ "path/filepath"
"strings"
"go.wit.com/gui"
@@ -94,8 +95,12 @@ func (s *section) add(path string) {
lw.Disable()
log.Info("downloading", tmp.path.String(), "here")
os.Setenv("GO111MODULE", "off")
- fullpath := "/home/jcarr/go/src/go.wit.com/"
- quickCmd(fullpath, []string{"go", "get", "-v", tmp.path.String()})
+
+ goSrcDir := me.goSrcPwd.String()
+ quickCmd(goSrcDir, []string{"go", "get", "-v", tmp.path.String()})
+
+ fullpath := filepath.Join(goSrcDir, tmp.path.String())
+ quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
lw.Enable()
})
if repostatus.VerifyLocalGoRepo(path) {
diff --git a/structs.go b/structs.go
index 55493cf..3c6acf3 100644
--- a/structs.go
+++ b/structs.go
@@ -55,6 +55,12 @@ type autoType struct {
// The current working directory
autoWorkingPwd *gadgets.OneLiner
+ // what is being used as your home dir
+ userHomePwd *gadgets.OneLiner
+
+ // what is being used as ~/go/src
+ goSrcPwd *gadgets.OneLiner
+
downloadEverythingButton *gui.Node
// delete ~/go/src & ~/go/pkg buttons