@@ -46,6 +46,14 @@ function HelpMsg()
function SetWorkspace()
{
+ if [ ! ${BASH_SOURCE[0]} -ef ./edksetup.sh ]
+ then
+ echo Run this script from the base of your tree. For example:
+ echo " cd /Path/To/Edk/Root"
+ echo " . edksetup.sh"
+ exit 1
+ fi
+
#
# If WORKSPACE is already set, then we can return right now
#
@@ -54,14 +62,6 @@ function SetWorkspace()
return 0
fi
- if [ ! ${BASH_SOURCE[0]} -ef ./edksetup.sh ]
- then
- echo Run this script from the base of your tree. For example:
- echo " cd /Path/To/Edk/Root"
- echo " . edksetup.sh"
- return 1
- fi
-
#
# Check for BaseTools/BuildEnv before dirtying the user's environment.
#
@@ -117,6 +117,8 @@ function SourceEnv()
SetupEnv
}
+[ "$0" = "./$SCRIPTNAME" ] && HelpMsg && exit 1
+
I=$#
while [ $I -gt 0 ]
do