aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-15 14:31:33 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-10-15 14:34:06 +0200
commit4982769bd48b5c67c5eff4d9c6f297fa2a7531a4 (patch)
tree9e1617b2a3411f6126f2cd500d13989ccef7f356
parentde8154b545ecdd5a35a0956ac5d93e26bb8ebc19 (diff)
fileconfig: env variables after default values
resolv env variables after setting default values if needed obviously, it will also resolv default values so it will fix EXEPATH bug Change-Id: If334d44374d021f9439288a46ed5827ea3b9fbe2 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rw-r--r--lib/xdsconfig/fileconfig.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go
index b786a24..374afa3 100644
--- a/lib/xdsconfig/fileconfig.go
+++ b/lib/xdsconfig/fileconfig.go
@@ -122,13 +122,6 @@ func readGlobalConfig(c *Config, confFile string) error {
if fCfg.SThgConf != nil {
vars = append(vars, &fCfg.SThgConf.Home, &fCfg.SThgConf.BinDir)
}
- for _, field := range vars {
- var err error
- if *field, err = common.ResolveEnvVar(*field); err != nil {
- return err
- }
- }
-
// Use config file settings else use default config
if fCfg.WebAppDir == "" {
fCfg.WebAppDir = c.FileConf.WebAppDir
@@ -149,6 +142,13 @@ func readGlobalConfig(c *Config, confFile string) error {
fCfg.LogsDir = c.FileConf.LogsDir
}
+ for _, field := range vars {
+ var err error
+ if *field, err = common.ResolveEnvVar(*field); err != nil {
+ return err
+ }
+ }
+
// Resolve webapp dir (support relative or full path)
fCfg.WebAppDir = strings.Trim(fCfg.WebAppDir, " ")
if !strings.HasPrefix(fCfg.WebAppDir, "/") && exePath != "" {