Fixed source env sdk file when file is not set.
[src/xds/xds-server.git] / lib / xdsserver / sdk.go
index e5d4d7c..d5b2b43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 "IoT.bzh"
+ * Copyright (C) 2017-2018 "IoT.bzh"
  * Author Sebastien Douheret <sebastien@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,10 +27,10 @@ import (
        "strings"
        "time"
 
+       common "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git/golib"
+       "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git/golib/eows"
+       "gerrit.automotivelinux.org/gerrit/src/xds/xds-server/lib/xsapiv1"
        "github.com/Sirupsen/logrus"
-       common "github.com/iotbzh/xds-common/golib"
-       "github.com/iotbzh/xds-common/golib/eows"
-       "github.com/iotbzh/xds-server/lib/xsapiv1"
        uuid "github.com/satori/go.uuid"
 )
 
@@ -492,5 +492,9 @@ func (s *CrossSDK) Get() *xsapiv1.SDK {
 
 // GetEnvCmd returns the command used to initialized the environment
 func (s *CrossSDK) GetEnvCmd() []string {
+       if s.sdk.SetupFile == "" {
+               return []string{}
+       }
        return []string{"source", s.sdk.SetupFile}
+
 }