summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-28 04:35:07 -0500
committerJeff Carr <[email protected]>2025-10-28 04:35:07 -0500
commit05d09b7584b4cd18676c68dd161142044437a7af (patch)
tree59ada03a3c607f6d7a383da4adcedf5654fa202c /init.go
parent59effd5ceba6f28e2bc2edd2b927abb4556f63b5 (diff)
load custom env files
Diffstat (limited to 'init.go')
-rw-r--r--init.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/init.go b/init.go
index ab1ccbf..4db6315 100644
--- a/init.go
+++ b/init.go
@@ -1,6 +1,7 @@
package env
import (
+ "fmt"
"os"
"os/user"
"path/filepath"
@@ -120,3 +121,13 @@ func parseENV(data string) {
envPB.Append(c)
}
}
+
+func LoadENV(filename string) error {
+ fpath := FullPath(filename)
+ fmt.Println("LoadENV", fpath)
+ data, err := os.ReadFile(fpath)
+ if err == nil {
+ parseFileData(filename, string(data))
+ }
+ return err
+}