diff options
| author | Jeff Carr <[email protected]> | 2025-10-05 12:32:55 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-05 12:32:55 -0500 |
| commit | f09240a122f09f297d96332c431db74857b93e6f (patch) | |
| tree | 48fb68c1dcc144bb5b577319fa93458e139ef899 | |
| parent | 71b54e6dd01fae2ecb5cc29890b12bbd1299aa6c (diff) | |
more cleanupsv0.1.18
| -rw-r--r-- | doUpgrade.go | 7 | ||||
| -rw-r--r-- | main.go | 39 | ||||
| -rw-r--r-- | structs.go | 11 |
3 files changed, 5 insertions, 52 deletions
diff --git a/doUpgrade.go b/doUpgrade.go index 8dece7c..5c644db 100644 --- a/doUpgrade.go +++ b/doUpgrade.go @@ -24,12 +24,7 @@ func doPackageList(all bool) { installed.Append(p) } } - installed.PrintTable() - log.Info("aptly repo -remove-files -force-replace add wit /home/aptly/incoming/autogenpb_0.5.16_amd64.deb") - log.Info("aptly repo remove wit basicwindow") - log.Info("aptly snapshot create wit-v0.8.3 from repo wit") - log.Info("aptly publish snapshot wit-v0.8.3") - log.Info("aptly -dry-run repo remove wit protoc-gen-go # remote a file") + me.machine.PrintTable(installed) } func doUpgrade() error { @@ -4,15 +4,11 @@ package main import ( - "debug/buildinfo" "embed" - "fmt" "os" - "path/filepath" "unicode" - "go.wit.com/dev/davecgh/spew" - "go.wit.com/log" + "go.wit.com/lib/gui/prep" ) // sent via -ldflags @@ -27,7 +23,9 @@ var resources embed.FS func main() { me = new(mainType) - me.once.Do(initMain) + // autocomplete must be processed before there is anything sent to STDOUT or STDERR + me.sh = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic if argv.Upgrade != nil { doUpgrade() @@ -89,32 +87,3 @@ func trimNonNumericFromStart(s string) string { } return "" } - -func dumpDebug() { - // Get absolute path of the currently running binary - exePath, err := os.Executable() - if err != nil { - fmt.Println("Error getting executable path:", err) - return - } - - // Resolve symlinks if necessary - exePath, err = filepath.EvalSymlinks(exePath) - if err != nil { - fmt.Println("Error resolving symlink:", err) - return - } - - // Read build info - bi, err := buildinfo.ReadFile(exePath) - if err != nil { - fmt.Println("Error reading build info:", err) - return - } - - log.Infof("%s built with Go version: %s\n", exePath, bi.GoVersion) - spew.Dump(bi) - for _, dep := range bi.Deps { - fmt.Printf("Dependency: %s %s\n", dep.Path, dep.Version) - } -} @@ -4,9 +4,7 @@ package main import ( - "os" "sync" - "time" "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/forgepb" @@ -18,7 +16,6 @@ var me *mainType // this app's variables type mainType struct { once sync.Once // one-time initialized data - start time.Time // what the app starts (used for timing automated runs) sh *prep.Auto // more experiments for bash handling forge *forgepb.Forge // your customized repo preferences and settings machine *zoopb.Machine // your customized repo preferences and settings @@ -38,11 +35,3 @@ func initMachine() { me.machine, _ = zoopb.InitMachine() } } - -func initMain() { - // autocomplete must be processed before there is anything sent to STDOUT or STDERR - me.sh = prep.Bash3(&argv) // add support for bash autocomplete with go-arg - me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic - me.start = time.Now() - dumpDebug() // tinkering -} |
