cosmetic changes
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
"log/slog"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
@@ -26,7 +27,13 @@ func New() {
|
||||
|
||||
configDir, _ := filepath.Abs(dir)
|
||||
|
||||
viper.AddConfigPath(configDir)
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
viper.AddConfigPath(configDir)
|
||||
case "linux":
|
||||
viper.AddConfigPath("/opt/sources/resource-scraper/config")
|
||||
}
|
||||
|
||||
viper.SetConfigName(configName)
|
||||
err := viper.ReadInConfig()
|
||||
if err != nil { // Handle errors reading the config file
|
||||
|
||||
Reference in New Issue
Block a user