diff options
| author | Jeff Carr <[email protected]> | 2025-09-12 10:12:21 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-12 10:12:21 -0500 |
| commit | de7b14f3c6cf56baf24a7d66df785dd595d4f85a (patch) | |
| tree | 63864f0d925b1caadfffdf9045597c2b0aa0e791 /configureENV.go | |
| parent | 5ae5010b004c97a5bfc8e5a3f9990af6ecc04290 (diff) | |
DumpENV()v0.0.20
Diffstat (limited to 'configureENV.go')
| -rw-r--r-- | configureENV.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/configureENV.go b/configureENV.go index 156ed43..5b3d51a 100644 --- a/configureENV.go +++ b/configureENV.go @@ -53,19 +53,22 @@ import ( func ConfigureENV() error { err := doConfigureENV() if os.Getenv("FORGE_VERBOSE") == "true" { - log.Printf("fhelp init: FORGE_CONFIG = %s\n", os.Getenv("FORGE_CONFIG")) - log.Printf("fhelp init: FORGE_REPOSDIR = %s\n", os.Getenv("FORGE_REPOSDIR")) - log.Printf("fhelp init: FORGE_REPOSPB = %s\n", os.Getenv("FORGE_REPOSPB")) - log.Printf("fhelp init: FORGE_PATCHDIR = %s\n", os.Getenv("FORGE_PATCHDIR")) - log.Printf("fhelp init: FORGE_URL = %s\n", os.Getenv("FORGE_URL")) - log.Printf("fhelp init: FORGE_GOWORK = %v\n", os.Getenv("FORGE_GOWORK")) - log.Printf("fhelp init: FORGE_VERBOSE = %s\n", os.Getenv("FORGE_VERBOSE")) - log.Printf("fhelp init: HOSTNAME = %s\n", os.Getenv("HOSTNAME")) - os.Exit(-1) + DumpENV("fhelp:") } return err } +func DumpENV(what string) { + log.Printf("%s FORGE_CONFIG = %s\n", what, os.Getenv("FORGE_CONFIG")) + log.Printf("%s FORGE_REPOSDIR = %s\n", what, os.Getenv("FORGE_REPOSDIR")) + log.Printf("%s FORGE_REPOSPB = %s\n", what, os.Getenv("FORGE_REPOSPB")) + log.Printf("%s FORGE_PATCHDIR = %s\n", what, os.Getenv("FORGE_PATCHDIR")) + log.Printf("%s FORGE_URL = %s\n", what, os.Getenv("FORGE_URL")) + log.Printf("%s FORGE_GOWORK = %s\n", what, os.Getenv("FORGE_GOWORK")) + log.Printf("%s FORGE_VERBOSE = %s\n", what, os.Getenv("FORGE_VERBOSE")) + log.Printf("%s HOSTNAME = %s\n", what, os.Getenv("HOSTNAME")) +} + // set the ENV vars // always set them to _something_ even when everything seems to be failing func doConfigureENV() error { @@ -104,7 +107,11 @@ func doConfigureENV() error { } if os.Getenv("FORGE_PATCHDIR") == "" { - os.Setenv("FORGE_PATCHDIR", os.Getenv("FORGE_REPOSDIR")) + pbdir, err := getCacheDir() + if err != nil { + return err + } + os.Setenv("FORGE_PATCHDIR", pbdir) } // setting FORGE_URL |
