debug
This commit is contained in:
parent
95a847d97c
commit
4a71d685da
3
Makefile
3
Makefile
|
@ -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
|
||||
|
|
14
plan/main.go
14
plan/main.go
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue