From 17937eb23c9536fbc4a38cd1d4ffa70fbf4d26b0 Mon Sep 17 00:00:00 2001 From: Philipp Wissmann Date: Wed, 28 Aug 2024 14:50:46 +0200 Subject: [PATCH] Fix config file search location Set cwd in launch task to executable parent folder --- openem-ingestor/.vscode/launch.json | 4 ++-- openem-ingestor/.vscode/tasks.json | 4 ++-- openem-ingestor/core/config.go | 2 -- openem-ingestor/{core => service}/openem-ingestor-config.yaml | 0 4 files changed, 4 insertions(+), 6 deletions(-) rename openem-ingestor/{core => service}/openem-ingestor-config.yaml (100%) diff --git a/openem-ingestor/.vscode/launch.json b/openem-ingestor/.vscode/launch.json index 11639dd..bc70f3c 100644 --- a/openem-ingestor/.vscode/launch.json +++ b/openem-ingestor/.vscode/launch.json @@ -8,7 +8,7 @@ "mode": "exec", "program": "${workspaceFolder}/desktop-app/build/bin/openem-ingestor", "preLaunchTask": "build app", - "cwd": "${workspaceFolder}", + "cwd": "${workspaceFolder}/desktop-app/build/bin", "env": {} }, { @@ -18,7 +18,7 @@ "mode": "exec", "program": "${workspaceFolder}/service/build/bin/openem-ingestor", "preLaunchTask": "build service", - "cwd": "${workspaceFolder}", + "cwd": "${workspaceFolder}/service/build/bin", "env": {} } ] diff --git a/openem-ingestor/.vscode/tasks.json b/openem-ingestor/.vscode/tasks.json index 187a71d..764654e 100644 --- a/openem-ingestor/.vscode/tasks.json +++ b/openem-ingestor/.vscode/tasks.json @@ -6,7 +6,7 @@ "type": "shell", "command": "cp", "args": [ - "${workspaceFolder}/core/openem-ingestor-config.yaml", + "${workspaceFolder}/desktop-app/openem-ingestor-config.yaml", "${workspaceFolder}/desktop-app/build/bin/" ] }, @@ -15,7 +15,7 @@ "type": "shell", "command": "cp", "args": [ - "${workspaceFolder}/core/openem-ingestor-config.yaml", + "${workspaceFolder}/service/openem-ingestor-config.yaml", "${workspaceFolder}/service/build/bin/" ] }, diff --git a/openem-ingestor/core/config.go b/openem-ingestor/core/config.go index ac66c16..9958800 100644 --- a/openem-ingestor/core/config.go +++ b/openem-ingestor/core/config.go @@ -54,9 +54,7 @@ func ReadConfig() error { userConfigDir, _ := os.UserConfigDir() viper.AddConfigPath(userConfigDir) - // these paths are mostly for development viper.AddConfigPath("./") - viper.AddConfigPath("./core") err := viper.ReadInConfig() return err diff --git a/openem-ingestor/core/openem-ingestor-config.yaml b/openem-ingestor/service/openem-ingestor-config.yaml similarity index 100% rename from openem-ingestor/core/openem-ingestor-config.yaml rename to openem-ingestor/service/openem-ingestor-config.yaml