summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-24 18:31:45 -0500
committerJeff Carr <[email protected]>2025-10-24 18:31:45 -0500
commite3f7c41f1082f132182c84961ab9fdf9666c8d79 (patch)
tree31d9761f8d7162d4b2918fd36fc1f973304b1519 /init.go
parenta2d6aac9f22bfe1060930e756a7dff86b3918f7e (diff)
s/ENV/env/ but ENV really is better herev0.0.189
Diffstat (limited to 'init.go')
-rw-r--r--init.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/init.go b/init.go
index d95d4bf..b3a4d2f 100644
--- a/init.go
+++ b/init.go
@@ -8,9 +8,9 @@ import (
"os/user"
"path/filepath"
- "go.wit.com/lib/ENV"
"go.wit.com/lib/cobol"
"go.wit.com/lib/config"
+ "go.wit.com/lib/env"
"go.wit.com/log"
)
@@ -62,27 +62,27 @@ func (f *Forge) Close() error {
func (f *Forge) postInit() error {
// always define
- if ENV.Get("username") == "" {
+ if env.Get("username") == "" {
usr, _ := user.Current()
- ENV.SetGlobal("lib/forgepb", "username", usr.Username)
- ENV.Save()
+ env.SetGlobal("lib/forgepb", "username", usr.Username)
+ env.Save()
}
// always define
- if ENV.Get("homeDir") == "" {
+ if env.Get("homeDir") == "" {
homeDir, _ := os.UserHomeDir()
- ENV.SetGlobal("lib/forgepb", "homeDir", homeDir)
- ENV.Save()
+ env.SetGlobal("lib/forgepb", "homeDir", homeDir)
+ env.Save()
}
// always define
- if ENV.Get("gopath") == "" {
- gopath := filepath.Join(ENV.Get("homedir"), "go/src")
- ENV.SetGlobal("lib/forgepb", "gopath", gopath)
+ if env.Get("gopath") == "" {
+ gopath := filepath.Join(env.Get("homedir"), "go/src")
+ env.SetGlobal("lib/forgepb", "gopath", gopath)
}
// always set f.mode
- switch ENV.Get("Mode") {
+ switch env.Get("Mode") {
case "NORMAL":
f.mode = ForgeMode_NORMAL
case "CLEAN":
@@ -94,12 +94,12 @@ func (f *Forge) postInit() error {
}
// todo: play with these / determine good values based on user's machine
- if cobol.Int(ENV.Get("RillX")) == 0 {
- ENV.SetGlobal("lib/forgepb", "RillX", "10")
+ if cobol.Int(env.Get("RillX")) == 0 {
+ env.SetGlobal("lib/forgepb", "RillX", "10")
}
- if cobol.Int(ENV.Get("RillY")) == 0 {
- ENV.SetGlobal("lib/forgepb", "RillY", "20")
- ENV.Save()
+ if cobol.Int(env.Get("RillY")) == 0 {
+ env.SetGlobal("lib/forgepb", "RillY", "20")
+ env.Save()
}
// create an initial repos.pb file