ent seteup
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"gitserver.in/patialtech/rano/pkg/logger"
|
||||
)
|
||||
|
||||
//
|
||||
@@ -12,12 +15,13 @@ import (
|
||||
|
||||
// Read all env (with same file loading semantics as Load) but return values as
|
||||
// a map rather than automatically writing values into env
|
||||
func Read(filenames ...string) (envMap map[string]string, err error) {
|
||||
func Read(dir string, filenames ...string) (envMap map[string]string, err error) {
|
||||
filenames = filenamesOrDefault(filenames)
|
||||
envMap = make(map[string]string)
|
||||
|
||||
for _, filename := range filenames {
|
||||
individualEnvMap, individualErr := readFile(filename)
|
||||
logger.Info("read env file %s", filepath.Join(dir, filename))
|
||||
individualEnvMap, individualErr := readFile(filepath.Join(dir, filename))
|
||||
|
||||
if individualErr != nil {
|
||||
err = individualErr
|
||||
|
Reference in New Issue
Block a user