summaryrefslogtreecommitdiffstats
path: root/lib/xdsconfig/config.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-17 11:28:57 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-17 14:04:32 +0200
commit40a7183f3b4aa32379aa8b4949f5f9c5e32f79f6 (patch)
tree25a98c1b6c6c7b5e186ae3cf0dc11807b2fa088a /lib/xdsconfig/config.go
parentc07adb807c41a1545a9a0f5bbf40080d86946538 (diff)
Add SDKs support.
Don't allow to install SDKs through XDS for now. Only probe existing SDKs that have been manually installed using scripts/agl/install-agl-sdks.sh. Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsconfig/config.go')
-rw-r--r--lib/xdsconfig/config.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go
index 3f8a91d..465620b 100644
--- a/lib/xdsconfig/config.go
+++ b/lib/xdsconfig/config.go
@@ -7,6 +7,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
+ "github.com/iotbzh/xds-server/lib/common"
)
// Config parameters (json format) of /config command
@@ -57,14 +58,14 @@ func Init(cliCtx *cli.Context, log *logrus.Logger) (*Config, error) {
}
// Update location of shared dir if needed
- if !dirExists(c.ShareRootDir) {
+ if !common.Exists(c.ShareRootDir) {
if err := os.MkdirAll(c.ShareRootDir, 0770); err != nil {
return nil, fmt.Errorf("No valid shared directory found: %v", err)
}
}
c.Log.Infoln("Share root directory: ", c.ShareRootDir)
- if c.FileConf.LogsDir != "" && !dirExists(c.FileConf.LogsDir) {
+ if c.FileConf.LogsDir != "" && !common.Exists(c.FileConf.LogsDir) {
if err := os.MkdirAll(c.FileConf.LogsDir, 0770); err != nil {
return nil, fmt.Errorf("Cannot create logs dir: %v", err)
}
@@ -73,11 +74,3 @@ func Init(cliCtx *cli.Context, log *logrus.Logger) (*Config, error) {
return &c, nil
}
-
-func dirExists(path string) bool {
- _, err := os.Stat(path)
- if os.IsNotExist(err) {
- return false
- }
- return true
-}