summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--argv.go8
-rwxr-xr-xbuild2
-rw-r--r--control10
-rw-r--r--doGit.go27
-rw-r--r--main.go15
6 files changed, 57 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 2002a94..69c33cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
*.swp
go.mod
go.sum
+wit
wit-test
/files/*
+*.deb
diff --git a/argv.go b/argv.go
index 989d22b..eddb48c 100644
--- a/argv.go
+++ b/argv.go
@@ -20,6 +20,7 @@ import (
var argv args
type args struct {
+ Git *GitCmd `arg:"subcommand:git" help:"git stuff"`
TestBuild *DefaultCmd `arg:"subcommand:build" help:"try appropriate 'go build'"`
DebBuild *DebianCmd `arg:"subcommand:debian" help:"build missing .deb packages"`
MacBuild *EmptyCmd `arg:"subcommand:macos" help:"build macos packages"`
@@ -50,6 +51,11 @@ type DefaultCmd struct {
Force bool `arg:"--force" help:"rebuild everything"`
}
+type GitCmd struct {
+ Log *EmptyCmd `arg:"subcommand:log" help:"go-clone from a gowebd repomap"`
+ Who *EmptyCmd `arg:"subcommand:who" help:"go-clone from a gowebd repomap"`
+}
+
type EmptyCmd struct {
}
@@ -90,7 +96,7 @@ func (args) Appname() string {
func (a args) DoAutoComplete(pb *prep.Auto) {
if pb.Cmd == "" {
- pb.Autocomplete3([]string{"--bash", "build", "debian", "install", "upgrade", "macos", "--witcom --version"})
+ pb.Autocomplete3([]string{"push", "build", "debian", "install", "upgrade", "macos", "git", "--witcom --version"})
} else {
pb.SubCommand(pb.Argv...)
}
diff --git a/build b/build
index 3a9d0df..54edc1e 100755
--- a/build
+++ b/build
@@ -1,4 +1,4 @@
#!/bin/bash -x
mkdir -p files/usr/share/bash-completion/completions/
-wit-test --bash > files/usr/share/bash-completion/completions/wit-test
+wit --bash > files/usr/share/bash-completion/completions/wit
diff --git a/control b/control
new file mode 100644
index 0000000..0619cbb
--- /dev/null
+++ b/control
@@ -0,0 +1,10 @@
+Source: wit-tools
+Build-Depends: golang
+Package: wit-tools
+Conflicts: wit
+Maintainer: Jeff Carr <[email protected]>
+Architecture: amd64
+Depends:
+URL: https://go.wit.com/apps/apps/utils/wit
+Description: used on wit cloud machines
+ customized for WIT private clouds
diff --git a/doGit.go b/doGit.go
new file mode 100644
index 0000000..3b77830
--- /dev/null
+++ b/doGit.go
@@ -0,0 +1,27 @@
+// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
+// Use of this source code is governed by the GPL 3.0
+
+package main
+
+import (
+ "go.wit.com/lib/gui/shell"
+ "go.wit.com/log"
+)
+
+func doGit() error {
+ log.DaemonMode(true)
+ defer log.DaemonMode(false)
+
+ if argv.Git.Log != nil {
+ fstr := "--format=\"%h %>(24)%ar %>(20)%an %s"
+ cmd := []string{"git", "log", fstr}
+ shell.RunVerbose(cmd)
+ }
+
+ if argv.Git.Who != nil {
+ cmd := []string{"git", "who"}
+ shell.RunVerbose(cmd)
+ }
+
+ return nil
+}
diff --git a/main.go b/main.go
index 445ca89..0f53c6c 100644
--- a/main.go
+++ b/main.go
@@ -22,7 +22,7 @@ var VERSION string
var BUILDTIME string
// used for shell auto completion
-var ARGNAME string = "wit-test" // todo: get this from $0 ?
+var ARGNAME string = "wit" // todo: get this from $0 ?
var failed map[*gitpb.Repo]string
var state map[*gitpb.Repo]string
@@ -34,16 +34,21 @@ func main() {
dumpDebug()
- failed = make(map[*gitpb.Repo]string)
- state = make(map[*gitpb.Repo]string)
- debnames = make(map[*gitpb.Repo]string)
-
if argv.Upgrade != nil {
me.machine, _ = zoopb.InitMachine()
doAptUpgrade()
okExit("")
}
+ if argv.Git != nil {
+ doGit()
+ okExit("")
+ }
+
+ failed = make(map[*gitpb.Repo]string)
+ state = make(map[*gitpb.Repo]string)
+ debnames = make(map[*gitpb.Repo]string)
+
me.forge = forgepb.Init()
me.forge.Config.DumpENV()