Add option --config and --data to specify where to store the configuration and the data
This commit is contained in:
parent
855f4d3e64
commit
ca81475fa5
8 changed files with 33 additions and 22 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue