diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-18 17:46:09 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-18 18:13:44 +0200 |
commit | 8d6d7494cf0f9c0f14b5082820082e85576a41da (patch) | |
tree | 4c91cc3a38239a736afa248fda18114fa4bdf6b4 /lib/xdsconfig/fileconfig.go | |
parent | 41109938056e2c0ca3af355de8947380e9a3b557 (diff) |
Improved syncthing binary path detection.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsconfig/fileconfig.go')
-rw-r--r-- | lib/xdsconfig/fileconfig.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go index 2795206..1ad2ea3 100644 --- a/lib/xdsconfig/fileconfig.go +++ b/lib/xdsconfig/fileconfig.go @@ -75,11 +75,13 @@ func updateConfigFromFile(c *Config, confFile string) (*FileConfig, error) { } // Support environment variables (IOW ${MY_ENV_VAR} syntax) in agent-config.json - for _, field := range []*string{ + vars := []*string{ &fCfg.LogsDir, - &fCfg.SThgConf.Home, - &fCfg.SThgConf.BinDir} { - + } + if fCfg.SThgConf != nil { + vars = append(vars, &fCfg.SThgConf.Home, &fCfg.SThgConf.BinDir) + } + for _, field := range vars { var err error *field, err = common.ResolveEnvVar(*field) if err != nil { |