diff options
| author | Jeff Carr <[email protected]> | 2025-10-22 09:18:26 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-22 09:18:26 -0500 | 
| commit | 98f656afbc699e2c3f6cf47cdb88af31b46134a8 (patch) | |
| tree | 00162a7a872a76b99a225df84898d5129e2ee0a7 | |
| parent | f945380a98f0b52a4b5d1614295700a92fdd5f2b (diff) | |
step1v0.7.112
| -rw-r--r-- | argv.template.go | 3 | ||||
| -rw-r--r-- | clone.go | 3 | ||||
| -rw-r--r-- | main.go | 11 | ||||
| -rw-r--r-- | work.go | 7 | 
4 files changed, 13 insertions, 11 deletions
diff --git a/argv.template.go b/argv.template.go index e7a9948..1808722 100644 --- a/argv.template.go +++ b/argv.template.go @@ -10,6 +10,7 @@ import (  	"go.wit.com/dev/alexflint/arg"  	"go.wit.com/gui" +	"go.wit.com/lib/ENV"  	"go.wit.com/lib/fhelp"  	"go.wit.com/log"  ) @@ -63,7 +64,7 @@ func (args) InitGui() error {  func (args) Exit() {  	gui.UnloadToolkits() -	if me.argv.Verbose() { +	if ENV.Verbose() {  		log.Info("argv.Exit() called", APPNAME+".Exit()")  	}  	// remove this from the template for your app (or make one for youself if you need it) @@ -7,6 +7,7 @@ import (  	"path/filepath"  	"strings" +	"go.wit.com/lib/ENV"  	"go.wit.com/lib/protobuf/gitpb"  	"go.wit.com/log"  ) @@ -68,7 +69,7 @@ func clone(gopath string) (*gitpb.Repo, error) {  	gopath = CleanRepoURL(gopath)  	os.Setenv("REPO_AUTO_CLONE", "true")  	// pb, _ := me.forge.NewGoPath(gopath) -	check := me.forge.FindAnyPath(filepath.Join(me.forge.Config.ReposDir, gopath)) +	check := me.forge.FindAnyPath(filepath.Join(ENV.Get("gopath"), gopath))  	if check != nil {  		if check.IsValidDir() {  			// repo already exists and is valid @@ -1,8 +1,7 @@  package main  import ( -	"os" - +	"go.wit.com/lib/ENV"  	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/lib/protobuf/forgepb"  	"go.wit.com/lib/protobuf/gitpb" @@ -74,12 +73,12 @@ func okExit(thing string) {  		log.Info(thing, "ok")  	}  	log.Info("Finished clone on", workingRepo.GetGoPath(), "ok") -	me.forge.ConfigSave() -	os.Exit(0) +	me.forge.Save() +	me.argv.GoodExit(thing)  }  func badExit(err error) {  	log.Info("Total repositories:", me.forge.Repos.Len()) -	log.Info("Finished go-clone with error", err, me.forge.Config.ReposDir) -	os.Exit(-1) +	s := log.Sprintf("go-clone error in %s", ENV.Get("gopath")) +	me.argv.BadExit(s, err)  } @@ -1,6 +1,7 @@  package main  import ( +	"go.wit.com/lib/ENV"  	"go.wit.com/lib/gui/shell"  	"go.wit.com/log"  ) @@ -10,10 +11,10 @@ func autoWork() {  	if !argv.AutoWork {  		return  	} -	log.Info("About to re-create", me.forge.Config.ReposDir+"/go.work") -	shell.PathRun(me.forge.Config.ReposDir, []string{"mv", "go.work", "go.work.last"}) +	log.Info("About to re-create", ENV.Get("gopath")+"/go.work") +	shell.PathRun(ENV.Get("gopath"), []string{"mv", "go.work", "go.work.last"})  	me.forge.MakeGoWork() -	shell.PathRun(me.forge.Config.ReposDir, []string{"go", "work", "use"}) +	shell.PathRun(ENV.Get("gopath"), []string{"go", "work", "use"})  	log.Info("")  	log.Info("original go.work file saved as go.work.last")  	log.Info("")  | 
