summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 01:53:14 -0500
committerJeff Carr <[email protected]>2025-09-11 01:53:14 -0500
commit602e1fc4aea522217775e5587fc1bd91dd3f060c (patch)
treedec2b3e9e80a2c7c5b52108ed03be14163120229 /main.go
parent2b3dfe540c6bac279067a4e2bdfe090d499be045 (diff)
redo config handling
Diffstat (limited to 'main.go')
-rw-r--r--main.go36
1 files changed, 5 insertions, 31 deletions
diff --git a/main.go b/main.go
index d4526a8..c9a4061 100644
--- a/main.go
+++ b/main.go
@@ -8,7 +8,6 @@ package main
import (
"embed"
"fmt"
- "os"
"strings"
"time"
@@ -50,37 +49,12 @@ func main() {
me.myGui = prep.Gui() // prepares the GUI package for go-args
me.pp = arg.MustParse(&argv)
- /*
- if argv.Bash {
- fhelp.DoBash(ARGNAME)
- os.Exit(0)
- }
- if len(argv.BashAuto) != 0 {
- argv.doBashAuto()
- os.Exit(0)
- }
- */
- me.urlbase = argv.URL
- if me.urlbase == "" {
- me.urlbase = "https://go.wit.com/"
- }
- if os.Getenv("FORGE_URL") != "" {
- me.urlbase = os.Getenv("FORGE_URL")
- log.Info("got forge url", me.urlbase)
- }
- me.urlbase = strings.Trim(me.urlbase, "/") // track down why trailing '/' makes http POST not work
-
- // internally debugging can be triggered here before Init()
- if argv.Debug != nil {
- doDebug()
- okExit("")
- }
-
- if forgepb.FirstTimeUser() {
- log.Info("You are running forge for the first time here")
- }
// load the ~/.config/forge/ config
- me.forge = forgepb.Init()
+ cfg, err := configInit()
+ if err != nil {
+ badExit(err)
+ }
+ me.forge = forgepb.InitFromConfig(cfg)
// initialize patches
doPatchInit()