command line option to rebuild
This commit is contained in:
parent
ec11efc347
commit
1d4817f6af
3
argv.go
3
argv.go
|
@ -26,13 +26,14 @@ type args struct {
|
|||
GitPull *FindCmd `arg:"subcommand:pull" help:"run 'git pull'"`
|
||||
URL string `arg:"--connect" help:"forge url"`
|
||||
All bool `arg:"--all" help:"git commit --all"`
|
||||
Show string `arg:"--show" help:"show a repo"`
|
||||
Build string `arg:"--build" help:"build a repo"`
|
||||
Install string `arg:"--install" help:"install a repo"`
|
||||
BuildForge bool `arg:"--forge-rebuild" help:"download and rebuild forge"`
|
||||
Force bool `arg:"--force" help:"try to strong arm things"`
|
||||
Verbose bool `arg:"--verbose" help:"show more output"`
|
||||
Bash bool `arg:"--bash" help:"generate bash completion"`
|
||||
BashAuto []string `arg:"--auto-complete" help:"todo: move this to go-arg"`
|
||||
// Show string `arg:"--show" help:"show a repo"`
|
||||
}
|
||||
|
||||
type EmptyCmd struct {
|
||||
|
|
22
main.go
22
main.go
|
@ -79,6 +79,11 @@ func main() {
|
|||
okExit("")
|
||||
}
|
||||
|
||||
if argv.BuildForge {
|
||||
buildForge()
|
||||
okExit("")
|
||||
}
|
||||
|
||||
if argv.Checkout != nil {
|
||||
if err := doCheckout(); err != nil {
|
||||
badExit(err)
|
||||
|
@ -124,23 +129,6 @@ func main() {
|
|||
okExit("")
|
||||
}
|
||||
|
||||
if argv.Show != "" {
|
||||
repo := me.forge.FindByGoPath(argv.Show)
|
||||
me.forge.HumanPrintRepo(repo)
|
||||
// newt := repo.Times.LastUpdate.AsTime()
|
||||
// oldt := repo.Times.MtimeHead.AsTime()
|
||||
if repo.Times.LastUpdate == nil {
|
||||
log.Info("SHOULD RUN Reload() here")
|
||||
repo.Reload()
|
||||
me.forge.HumanPrintRepo(repo)
|
||||
} else {
|
||||
if repo.Times.LastUpdate.Seconds < repo.Times.MtimeHead.Seconds {
|
||||
log.Info("SHOULD RUN Reload() here")
|
||||
}
|
||||
}
|
||||
okExit("")
|
||||
}
|
||||
|
||||
if argv.GitFetch != nil {
|
||||
doGitFetch()
|
||||
okExit("")
|
||||
|
|
|
@ -6,6 +6,8 @@ package main
|
|||
// An app to submit patches for the 30 GO GUI repos
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"go.wit.com/lib/fhelp"
|
||||
"go.wit.com/lib/gui/shell"
|
||||
"go.wit.com/log"
|
||||
|
@ -43,6 +45,12 @@ func makeHowtoWin() *genericWindow {
|
|||
grid.NewButton("Download", func() {
|
||||
howtoWin.Disable()
|
||||
defer howtoWin.Enable()
|
||||
buildForge()
|
||||
})
|
||||
return howtoWin
|
||||
}
|
||||
|
||||
func buildForge() {
|
||||
log.Info("download here")
|
||||
if path, err := fhelp.CheckCmd("go-clone"); err != nil {
|
||||
log.Info("go-clone missing", path, err)
|
||||
|
@ -64,10 +72,9 @@ func makeHowtoWin() *genericWindow {
|
|||
var basecmd []string
|
||||
var cmd []string
|
||||
if me.forge.IsGoWork() {
|
||||
log.Info("NOT GO WORK")
|
||||
log.Info("Using go.work directory")
|
||||
basecmd = []string{"go-clone", "--work", "--recursive"}
|
||||
} else {
|
||||
log.Info("IS GO WORK")
|
||||
basecmd = []string{"go-clone", "--recursive"}
|
||||
}
|
||||
// log.Info("Running:", cmd)
|
||||
|
@ -76,6 +83,7 @@ func makeHowtoWin() *genericWindow {
|
|||
cmd = append(basecmd, "go.wit.com/apps/go-mod-clean")
|
||||
log.Info("Running:", cmd)
|
||||
shell.RunRealtime(cmd)
|
||||
os.Exit(-1)
|
||||
|
||||
cmd = append(basecmd, "go.wit.com/apps/forge")
|
||||
log.Info("Running:", cmd)
|
||||
|
@ -96,6 +104,4 @@ func makeHowtoWin() *genericWindow {
|
|||
repo.RunVerbose([]string{"autogenpb"})
|
||||
}
|
||||
*/
|
||||
})
|
||||
return howtoWin
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue