transfer_middleware/until/env.go

23 lines
329 B
Go
Raw Normal View History

2024-07-16 18:26:51 +08:00
package until
2024-07-16 18:39:48 +08:00
2024-07-16 18:54:13 +08:00
import (
"fmt"
"os"
)
2024-07-16 18:39:48 +08:00
func GetConfig() string {
2024-07-16 18:54:13 +08:00
var dir string
pwd, _ := os.Getwd()
path := fmt.Sprintf("%s%s", pwd, "/../../env")
bytes, _ := os.ReadFile(path)
switch string(bytes) {
case "produce":
dir = "produce.yaml"
case "test":
dir = "test.yaml"
default:
dir = "local.yaml"
}
return dir
2024-07-16 18:39:48 +08:00
}