Skip to content

Commit b1ba665

Browse files
committed
feat(backend): get cfg path form env
Signed-off-by: Me0wo <152751263+Sn0wo2@users.noreply.github.com>
1 parent fc4279d commit b1ba665

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/config/config.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ var Instance Config
1515

1616
// Init contains validation config
1717
func Init() error {
18-
cfgPath := "./data/config.yml"
18+
cfgPath := os.Getenv("CONFIG_PATH")
1919
if debug.IsDebug() {
20-
cfgPath = "./data/config_test.yml"
20+
cfgPath = os.Getenv("CONFIG_PATH_DEBUG")
21+
}
22+
if cfgPath == "" {
23+
cfgPath = "./data/config.yml"
2124
}
2225

2326
cf, err := os.ReadFile(cfgPath)

0 commit comments

Comments
 (0)