Allow XDT_SDK overwrite
[src/xds/xds-server.git] / scripts / sdks / agl / _env-init.sh
index 9d4b398..cc91107 100755 (executable)
 # limitations under the License.
 ###########################################################################
 
-[ -f /etc/xdtrc ] && . /etc/xdtrc
-
 if [ -z "$XDT_SDK" ]; then
-    # For backward compatibility and compliance with AGL DevKit docker image
-       [ -d "/xdt/sdk" ] && export XDT_SDK=/xdt/sdk || export XDT_SDK=$HOME/xds-workspace/.sdks
+    [ -f /etc/xdtrc ] && . /etc/xdtrc
+
+    if [ -z "$XDT_SDK" ]; then
+        # For backward compatibility and compliance with AGL DevKit docker image
+       [ -d "/xdt/sdk" ] && export XDT_SDK=/xdt/sdk || export XDT_SDK=$HOME/xds-workspace/.sdks
+    fi
 fi
 
 export SDK_FAMILY_NAME="agl"
@@ -29,4 +31,4 @@ export SDK_ROOT_DIR="$XDT_SDK"
 export SDK_ENV_SETUP_FILENAME="environment-setup-*"
 export SDK_DATABASE="http://iot.bzh/download/public/XDS/sdk/sdks_latest.json"
 
-[ "$1" = "-print" ] && { env; }
\ No newline at end of file
+[ "$1" = "-print" ] && { env; }