summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-11 23:10:26 -0500
committerJeff Carr <[email protected]>2025-09-11 23:10:26 -0500
commit2b6107fa51028324196b5c7e08f82b4b1b0bf0ce (patch)
treef44ef6577ad4844fb617aa26383f2edbedf77ab0
parent7a76b5acd122c094849e718f8e3dff5c7211e725 (diff)
-rw-r--r--config.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/config.go b/config.go
index 8e30e06..81dba5a 100644
--- a/config.go
+++ b/config.go
@@ -6,6 +6,7 @@ package main
import (
"errors"
"os"
+ "path/filepath"
"go.wit.com/lib/config"
"go.wit.com/lib/protobuf/forgepb"
@@ -22,8 +23,8 @@ func configInit() *forgepb.ForgeConfigs {
}
// the default forged dir is /home/forge
- if os.Getenv("FORGE_GOSRC") == "" {
- os.Setenv("FORGE_GOSRC", "/home/forge")
+ if os.Getenv("FORGE_REPODIR") == "" {
+ os.Setenv("FORGE_REPODIR", "/home/forge")
}
if os.Getenv("FORGE_PATCHDIR") == "" {
@@ -33,9 +34,9 @@ func configInit() *forgepb.ForgeConfigs {
configs := new(forgepb.ForgeConfigs)
err := config.ConfigLoad(configs, ARGNAME, "forge")
if errors.Is(err, os.ErrNotExist) {
- configs.ReposDir = "/home/forge"
- configs.ReposPB = "/home/forge/repos.pb"
- configs.PatchDir = "/var/lib/forged"
+ configs.ReposDir = os.Getenv("FORGE_REPODIR")
+ configs.ReposPB = filepath.Join(configs.ReposDir, "repos.pb")
+ configs.PatchDir = os.Getenv("FORGE_PATCHDIR")
if err := configSave(); err != nil {
badExit(err)
}