summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-08-28 12:38:42 -0500
committerJeff Carr <[email protected]>2025-08-28 19:30:59 -0500
commit6b6b31eef6f6a636db0750fcd0d59e3e0758013e (patch)
tree86eef1ff8c9fcc2f3842688d7c0e02402421d64f /main.go
parent81885f44834b0f3a20999d8031ed0fc3bf6a0fa5 (diff)
stub in code to start the process of processing patches
Diffstat (limited to 'main.go')
-rw-r--r--main.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/main.go b/main.go
index 4e45f57..c82397a 100644
--- a/main.go
+++ b/main.go
@@ -7,26 +7,41 @@ import (
"os"
"time"
+ "go.wit.com/dev/alexflint/arg"
+ "go.wit.com/gui"
"go.wit.com/log"
)
// are sent via -ldflags at buildtime
var VERSION string
var BUILDTIME string
+var ARGNAME string = "forged"
//go:embed resources/*
var resources embed.FS
-// var forge *forgepb.Forge
-
var HOSTNAME string = "forge.wit.com"
var LIBDIR string = "/var/lib/forged/"
var FORGEDIR string = "/home/forge"
func main() {
+ me = new(mainType)
+ gui.InitArg()
+ me.pp = arg.MustParse(&argv)
+
+ if argv.Bash {
+ argv.doBash()
+ os.Exit(0)
+ }
+ if len(argv.BashAuto) != 0 {
+ argv.doBashAuto()
+ os.Exit(0)
+ }
+
if argv.Hostname != "" {
HOSTNAME = argv.Hostname
}
+
// the default forged dir is /home/forge
if os.Getenv("FORGE_GOSRC") == "" {
os.Setenv("FORGE_GOSRC", "/home/forge")
@@ -37,6 +52,11 @@ func main() {
okExit("")
}
+ if argv.Pull != nil {
+ log.Info("pull here")
+ okExit("")
+ }
+
http.HandleFunc("/", okHandler)
// go https() // use caddy instead
p := fmt.Sprintf(":%d", argv.Port)