Skip to content

Commit

Permalink
priorize dev config file
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Jan 5, 2024
1 parent 51ce673 commit 15b3ca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
todo.md
tzproxy.dev.yaml
7 changes: 7 additions & 0 deletions config/viper.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"os"
"strings"

"github.com/rs/zerolog/log"
Expand All @@ -9,11 +10,17 @@ import (

func initViper() *ConfigFile {


// Set the configuration file name and path
viper.SetConfigName("tzproxy")
viper.SetConfigType("yaml")
viper.AddConfigPath(".")

// Check if the tzproxy.dev.yaml configuration file exists
if _, err := os.Stat("tzproxy.dev.yaml"); err == nil {
viper.SetConfigName("tzproxy.dev")
}

// Read the configuration file
viper.ReadInConfig()

Expand Down

0 comments on commit 15b3ca5

Please sign in to comment.