]> git.proxmox.com Git - mirror_edk2.git/blobdiff - edksetup.sh
Report the setting variable failure to platform through the status code when core...
[mirror_edk2.git] / edksetup.sh
index 39b76e1c2258bc5bec3acc2d505269c4a2eab59e..0b7e33fd77769eefa62b30278003ef54830b31ca 100755 (executable)
@@ -30,6 +30,7 @@ function HelpMsg()
   echo Please note: This script must be \'sourced\' so the environment can be changed.
   echo ". edksetup.sh" 
   echo "source edksetup.sh"
+  return 1
 }
 
 function SetupEnv()
@@ -44,26 +45,31 @@ function SetupEnv()
 
 function SourceEnv()
 {
-if [ \
-     "$1" = "-?" -o \
-     "$1" = "-h" -o \
-     "$1" = "--help" \
-   ]
-then
-  HelpMsg
-  return
-else
-  SetupEnv "$*"
-fi
+  if [ \
+       "$1" = "-?" -o \
+       "$1" = "-h" -o \
+       "$1" = "--help" \
+     ]
+  then
+    HelpMsg
+  else
+    SetupEnv "$*"
+  fi
 }
-if [ $# -gt 1 ] 
+
+if [ $# -gt 1 ]
 then
   HelpMsg
-  return
-elif [ $# -eq 1 ] && [ "$1" != "BaseTool" ]
+elif [ $# -eq 1 ] && [ "$1" != "BaseTools" ]
 then
   HelpMsg
-  return
-fi 
+fi
+
+RETVAL=$?
+if [ $RETVAL -ne 0 ]
+then
+  return $RETVAL
+fi
+
 SourceEnv "$*"