diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-18 18:14:37 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-09-18 18:14:37 +0200 |
commit | d4f7b45c3fe483d3864534642f10cf8f6ee23ae9 (patch) | |
tree | f87d948e5ab337f4929734e19e3781ed672c0b30 /lib/xdsconfig | |
parent | d007a7512af1f6c9b9ab9a238b47f1ebfc9f4dc8 (diff) |
Fix syncthing binary path detection.
Diffstat (limited to 'lib/xdsconfig')
-rw-r--r-- | lib/xdsconfig/config.go | 2 | ||||
-rw-r--r-- | lib/xdsconfig/fileconfig.go | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go index 53d1639..f3cba4a 100644 --- a/lib/xdsconfig/config.go +++ b/lib/xdsconfig/config.go @@ -37,7 +37,7 @@ type Options struct { const ( DefaultAPIVersion = "1" DefaultPort = "8000" - DefaultShareDir = "/mnt/share" + DefaultShareDir = "${HOME}/.xds-server/projects" DefaultSdkRootDir = "/xdt/sdk" ) diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go index a0724af..2651caf 100644 --- a/lib/xdsconfig/fileconfig.go +++ b/lib/xdsconfig/fileconfig.go @@ -59,11 +59,12 @@ func readGlobalConfig(c *Config, confFile string) error { searchIn = append(searchIn, "/etc/xds-server/config.json") exePath := os.Args[0] - exeAbsPath, err := filepath.Abs(os.Args[0]) + ee, _ := os.Executable() + exeAbsPath, err := filepath.Abs(ee) if err == nil { exePath, err = filepath.EvalSymlinks(exeAbsPath) if err == nil { - exePath = filepath.Dir(exePath) + exePath = filepath.Dir(ee) } else { exePath = filepath.Dir(exeAbsPath) } |