summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMete Polat <metepolat2000@gmail.com>2016-02-26 16:42:51 +0100
committerKhalid Zubair <kzubair@cyngn.com>2016-03-01 11:28:12 -0800
commit171957c0bdc547ae6013daddffc03c8ec3ac2e3e (patch)
tree907bda65ac1cfa0cced475237eb0e4f207e7f26b
parent52254723807e94bbb9353bab5ded3cfa488573aa (diff)
downloadandroid_development-171957c0bdc547ae6013daddffc03c8ec3ac2e3e.tar.gz
android_development-171957c0bdc547ae6013daddffc03c8ec3ac2e3e.tar.bz2
android_development-171957c0bdc547ae6013daddffc03c8ec3ac2e3e.zip
idegen: Check if environment variable exists
Check if the $ANDROID_HOST_OUT variable exists in the environment Change-Id: I1086f34188f306ad4b864c7461b3f5cd263a89a7
-rwxr-xr-xtools/idegen/idegen.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/idegen/idegen.sh b/tools/idegen/idegen.sh
index 1c3ba18cc..2dbff37b1 100755
--- a/tools/idegen/idegen.sh
+++ b/tools/idegen/idegen.sh
@@ -5,9 +5,14 @@ if [ ! -d development ]; then
exit 1
fi
+if [ -z "$ANDROID_HOST_OUT" ]; then
+ echo "Couldn't find host out directory. Make sure ANDROID_HOST_OUT is in your environment."
+ exit 127
+fi
+
idegenjar=`find $ANDROID_HOST_OUT -name idegen.jar -follow | grep -v intermediates`
-if [ "" = "$idegenjar" ]; then
- echo "Couldn't find idegen.jar. Please run make first."
-else
+if [ -z "$idegenjar" ]; then
+ echo "Couldn't find idegen.jar. Please run 'make idegen' first."
+else
java -cp $idegenjar Main
fi