Add option --config and --data to specify where to store the configuration and the data

This commit is contained in:
Pierre-Alain TORET 2020-03-10 23:56:07 +01:00
parent 855f4d3e64
commit ca81475fa5
8 changed files with 33 additions and 22 deletions

View file

@ -3,8 +3,8 @@ package config
import (
"time"
"github.com/fsnotify/fsnotify"
"github.com/khlieng/dispatch/storage"
"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
)
@ -53,7 +53,7 @@ type LetsEncrypt struct {
func LoadConfig() (*Config, chan *Config) {
viper.SetConfigName("config")
viper.AddConfigPath(storage.Path.Root())
viper.AddConfigPath(storage.ConfigPath.Root())
viper.ReadInConfig()
config := &Config{}