add --do-patches
This commit is contained in:
parent
682acb3481
commit
6ea78a6e8b
3
Makefile
3
Makefile
|
@ -54,3 +54,6 @@ mine: install
|
||||||
|
|
||||||
gui: install
|
gui: install
|
||||||
forge --do-gui
|
forge --do-gui
|
||||||
|
|
||||||
|
patches: install
|
||||||
|
forge --do-patches
|
||||||
|
|
2
argv.go
2
argv.go
|
@ -21,7 +21,7 @@ type args struct {
|
||||||
DoBuild bool `arg:"--do-build" default:"true" help:"also try to build it"`
|
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"`
|
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"`
|
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"`
|
DoGui bool `arg:"--do-gui" help:"test the gui"`
|
||||||
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
DryRun bool `arg:"--dry-run" help:"show what would be run"`
|
||||||
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
Fix bool `arg:"--fix" help:"fix config, save config & exit"`
|
||||||
|
|
|
@ -35,15 +35,22 @@ func doGitPull() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doFix() {
|
func doFix() {
|
||||||
|
var fixed bool = false
|
||||||
all := me.found.SortByGoPath()
|
all := me.found.SortByGoPath()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
repo := all.Next()
|
repo := all.Next()
|
||||||
if !repo.IsValid() {
|
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
|
continue
|
||||||
}
|
}
|
||||||
log.Printf("running on: %-50s\n", repo.GetGoPath())
|
log.Printf("running on: %-50s\n", repo.GetGoPath())
|
||||||
cmd := []string{"ls"}
|
cmd := []string{"ls"}
|
||||||
repo.Run(cmd)
|
repo.Run(cmd)
|
||||||
}
|
}
|
||||||
|
if fixed {
|
||||||
|
me.forge.Repos.ConfigSave()
|
||||||
|
okExit("config saved")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
9
main.go
9
main.go
|
@ -64,11 +64,14 @@ func main() {
|
||||||
done = true
|
done = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if argv.DoPatchSet {
|
||||||
|
sendDevelDiff()
|
||||||
|
// sendMasterDiff()
|
||||||
|
okExit("patches")
|
||||||
|
}
|
||||||
|
|
||||||
// do the gui at the very end
|
// do the gui at the very end
|
||||||
if argv.DoGui {
|
if argv.DoGui {
|
||||||
sendDevelDiff()
|
|
||||||
sendMasterDiff()
|
|
||||||
okExit("patches")
|
|
||||||
doGui()
|
doGui()
|
||||||
}
|
}
|
||||||
if !done {
|
if !done {
|
||||||
|
|
Loading…
Reference in New Issue