summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-04 20:19:03 -0500
committerJeff Carr <[email protected]>2025-09-04 20:19:03 -0500
commitf54f189bcd079221cf314c616fbe1d993f43846e (patch)
treef4bc609710a0a5c5df67d3cd977bc8b96056116a /init.go
parentdbb0d9867d645c4082e910098fa84dc15299c454 (diff)
check if a config file exists for new users
Diffstat (limited to 'init.go')
-rw-r--r--init.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/init.go b/init.go
index 9f72a92..1dc1fb6 100644
--- a/init.go
+++ b/init.go
@@ -3,8 +3,10 @@
package forgepb
import (
+ "errors"
"os"
"os/user"
+ "path/filepath"
"time"
"go.wit.com/lib/fhelp"
@@ -83,16 +85,16 @@ func Init() *Forge {
func FirstTimeUser() bool {
if checkenv() {
- return true
+ return false
}
// setup the env
f := new(Forge)
f.setenv()
- f.Config = new(ForgeConfigs)
- if err := f.Config.ConfigLoad(f.configDir); err != nil {
- // no config
+ fullname := filepath.Join(os.Getenv("FORGE_CONFIG"), "forge.text")
+ _, err := os.ReadFile(fullname)
+ if errors.Is(err, os.ErrNotExist) {
return true
}
return false