Migrated to using viper's ConfigFileUsed().
This commit is contained in:
@@ -110,7 +110,7 @@ func (b *Api) handleConfigReload(c echo.Context) error {
|
||||
b.Log.Error("Error reading remote config file: ", err)
|
||||
return c.String(http.StatusInternalServerError, "Internal Server Error")
|
||||
}
|
||||
cfgfile := b.GetConfigFile()
|
||||
cfgfile := b.ConfigFileUsed()
|
||||
err = ioutil.WriteFile(cfgfile, content, 0644)
|
||||
if err != nil {
|
||||
b.Log.Error("Failed to write remote config file: ", err)
|
||||
|
||||
@@ -68,8 +68,8 @@ func (b *Bridge) joinChannels(channels map[string]config.ChannelInfo, exists map
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bridge) GetConfigFile() string {
|
||||
return b.Config.GetConfigFile()
|
||||
func (b *Bridge) ConfigFileUsed() string {
|
||||
return b.Config.ConfigFileUsed()
|
||||
}
|
||||
|
||||
func (b *Bridge) GetBool(key string) bool {
|
||||
|
||||
@@ -173,7 +173,6 @@ type ConfigValues struct {
|
||||
General Protocol
|
||||
Gateway []Gateway
|
||||
SameChannelGateway []SameChannelGateway
|
||||
ConfigFile string
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
@@ -234,8 +233,8 @@ func NewConfigFromString(input []byte) *Config {
|
||||
return mycfg
|
||||
}
|
||||
|
||||
func (c *Config) GetConfigFile() string {
|
||||
return c.v.GetString("ConfigFile")
|
||||
func (c *Config) ConfigFileUsed() string {
|
||||
return c.v.ConfigFileUsed()
|
||||
}
|
||||
|
||||
func (c *Config) GetBool(key string) bool {
|
||||
|
||||
Reference in New Issue
Block a user