Fix #606, Fix #610 [change] app, config: add symlink support, allow to specify absolute path in log_file
This commit is contained in:
10
config.go
10
config.go
@@ -137,9 +137,15 @@ var config = configuration{
|
||||
|
||||
// getConfigFilename returns path to the current config file
|
||||
func (c *configuration) getConfigFilename() string {
|
||||
configFile := config.ourConfigFilename
|
||||
configFile, err := filepath.EvalSymlinks(config.ourConfigFilename)
|
||||
if err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
log.Error("unexpected error while config file path evaluation: %s", err)
|
||||
}
|
||||
configFile = config.ourConfigFilename
|
||||
}
|
||||
if !filepath.IsAbs(configFile) {
|
||||
configFile = filepath.Join(config.ourWorkingDir, config.ourConfigFilename)
|
||||
configFile = filepath.Join(config.ourWorkingDir, configFile)
|
||||
}
|
||||
return configFile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user