setenv: check in a more robust way that the script is being sourced
[android/android-app-development-getting-started.git] / setenv
diff --git a/setenv b/setenv
index e5c51a5..b9a1569 100644 (file)
--- a/setenv
+++ b/setenv
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 #!/bin/sh
 
-[ "$0" = "$(basename $SHELL)" ] || { echo "This script is meant to be sourced, not executed" 1>&2; exit 1; }
+[ "${0#-}" = "$(basename $SHELL)" ] || { echo "This script is meant to be sourced, not executed" 1>&2; exit 1; }
 
 export ANDROID_HOME=$HOME/Android/android-sdk-linux
 export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
 
 export ANDROID_HOME=$HOME/Android/android-sdk-linux
 export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools