This commit is contained in:
Erik Winter 2024-12-21 14:01:58 +01:00
parent 95a847d97c
commit 4a71d685da
2 changed files with 12 additions and 5 deletions

View File

@ -4,5 +4,8 @@ plan-deploy:
sync-run:
cd sync/service && go run . -dbname localhost -dbport 5432 -dbname planner -dbuser test -dbpassword test -port 8092 -key testKey
sync-debug:
cd sync/service && dlv debug . -- -dbname localhost -dbport 5432 -dbname planner -dbuser test -dbpassword test -port 8092 -key testKey
database:
docker run -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -e POSTGRES_DB=planner -p 5432:5432 postgres:16

View File

@ -12,12 +12,16 @@ import (
)
func main() {
confPath, err := os.UserConfigDir()
if err != nil {
fmt.Printf("could not get config path: %s\n", err)
os.Exit(1)
confPath := os.Getenv("PLAN_CONFIG_PATH")
if confPath == "" {
userConfigDir, err := os.UserConfigDir()
if err != nil {
fmt.Printf("could not get config path: %s\n", err)
os.Exit(1)
}
confPath = filepath.Join(userConfigDir, "planner", "plan", "config.yaml")
}
conf, err := LoadConfig(filepath.Join(confPath, "planner", "plan", "config.yaml"))
conf, err := LoadConfig(confPath)
if err != nil {
fmt.Printf("could not open config file: %s\n", err)
os.Exit(1)