debug
This commit is contained in:
parent
95a847d97c
commit
4a71d685da
3
Makefile
3
Makefile
|
@ -4,5 +4,8 @@ plan-deploy:
|
||||||
sync-run:
|
sync-run:
|
||||||
cd sync/service && go run . -dbname localhost -dbport 5432 -dbname planner -dbuser test -dbpassword test -port 8092 -key testKey
|
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:
|
database:
|
||||||
docker run -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -e POSTGRES_DB=planner -p 5432:5432 postgres:16
|
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() {
|
func main() {
|
||||||
confPath, err := os.UserConfigDir()
|
confPath := os.Getenv("PLAN_CONFIG_PATH")
|
||||||
if err != nil {
|
if confPath == "" {
|
||||||
fmt.Printf("could not get config path: %s\n", err)
|
userConfigDir, err := os.UserConfigDir()
|
||||||
os.Exit(1)
|
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 {
|
if err != nil {
|
||||||
fmt.Printf("could not open config file: %s\n", err)
|
fmt.Printf("could not open config file: %s\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
Loading…
Reference in New Issue