From 66e38de29fae09be665a19da82269ed3234dbe8b Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sat, 10 Apr 2021 10:28:54 +0430 Subject: [PATCH] check for deps --- AndroidCompat/getAndroid.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AndroidCompat/getAndroid.sh b/AndroidCompat/getAndroid.sh index 78b7b52..53e53e2 100755 --- a/AndroidCompat/getAndroid.sh +++ b/AndroidCompat/getAndroid.sh @@ -8,6 +8,17 @@ # This is a bash script to create android.jar stubs +for dep in "curl" "base64" "zip" +do + which $dep >/dev/null 2>&1 || { echo >&2 "Error: This script needs $dep installed."; abort=yes; } +done + +if [ $abort = yes ]; then + echo "Some of the dependencies didn't exist. Aborting." + exit 1 +fi + + # foolproof against running from AndroidCompat dir instead of running from project root if [ "$(basename $(pwd))" = "AndroidCompat" ]; then cd ..