summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-13 13:17:26 -0600
committerJeff Carr <[email protected]>2024-12-13 13:17:26 -0600
commit6ea78a6e8ba73e98a396e03b9231bd2d6a9a5288 (patch)
tree456f0e2be1a341704485e90b4f7b31c21d40d127
parent682acb34813188d292f7d6312f7d3d5c0fdfb22b (diff)
add --do-patches
-rw-r--r--Makefile3
-rw-r--r--argv.go2
-rw-r--r--doCommon.go9
-rw-r--r--main.go9
4 files changed, 18 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 46a1249..bf158ce 100644
--- a/Makefile
+++ b/Makefile
@@ -54,3 +54,6 @@ mine: install
gui: install
forge --do-gui
+
+patches: install
+ forge --do-patches
diff --git a/argv.go b/argv.go
index ff8a1f0..5526312 100644
--- a/argv.go
+++ b/argv.go
@@ -21,7 +21,7 @@ type args struct {
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
DoInstall bool `arg:"--do-install" help:"try to install every binary package"`
DoRedoGoMod bool `arg:"--do-RedoGoMod" help:"remake all the go.sum and go.mod files"`
- DoErase bool `arg:"--do-EraseGoMod" help:"erase the go.mod and go.sum files"`
+ DoPatchSet bool `arg:"--do-patches" help:"make patch set"`
DoGui bool `arg:"--do-gui" help:"test the gui"`
DryRun bool `arg:"--dry-run" help:"show what would be run"`
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
diff --git a/doCommon.go b/doCommon.go
index 81578bf..85beb01 100644
--- a/doCommon.go
+++ b/doCommon.go
@@ -35,15 +35,22 @@ func doGitPull() {
}
func doFix() {
+ var fixed bool = false
all := me.found.SortByGoPath()
for all.Scan() {
repo := all.Next()
if !repo.IsValid() {
- log.Printf("%10s %-50s", "old?\n", repo.GetGoPath())
+ log.Printf("%10s %-50s", "old?\n", repo.GoPath)
+ me.forge.Repos.DeleteByGoPath(repo.GoPath)
+ fixed = true
continue
}
log.Printf("running on: %-50s\n", repo.GetGoPath())
cmd := []string{"ls"}
repo.Run(cmd)
}
+ if fixed {
+ me.forge.Repos.ConfigSave()
+ okExit("config saved")
+ }
}
diff --git a/main.go b/main.go
index 721cc76..35f0473 100644
--- a/main.go
+++ b/main.go
@@ -64,11 +64,14 @@ func main() {
done = true
}
- // do the gui at the very end
- if argv.DoGui {
+ if argv.DoPatchSet {
sendDevelDiff()
- sendMasterDiff()
+ // sendMasterDiff()
okExit("patches")
+ }
+
+ // do the gui at the very end
+ if argv.DoGui {
doGui()
}
if !done {