Android example: improve checks for existence of output directory.

This commit is contained in:
levlam 2022-08-13 10:37:16 +03:00
parent d1a6595c20
commit eca8cf94f4
2 changed files with 6 additions and 4 deletions

View File

@ -11,13 +11,15 @@ if [ ! -d "$ANDROID_SDK_ROOT" ] ; then
exit 1
fi
if [ -d "$OPENSSL_INSTALL_DIR" ] ; then
echo "Error: directory \"$OPENSSL_INSTALL_DIR\" already exists. Delete it manually to proceed."
if [ -e "$OPENSSL_INSTALL_DIR" ] ; then
echo "Error: file or directory \"$OPENSSL_INSTALL_DIR\" already exists. Delete it manually to proceed."
exit 1
fi
source ./check-environment.sh || exit 1
mkdir -p $OPENSSL_INSTALL_DIR || exit 1
ANDROID_SDK_ROOT="$(cd "$(dirname -- "$ANDROID_SDK_ROOT")" >/dev/null; pwd -P)/$(basename -- "$ANDROID_SDK_ROOT")"
OPENSSL_INSTALL_DIR="$(cd "$(dirname -- "$OPENSSL_INSTALL_DIR")" >/dev/null; pwd -P)/$(basename -- "$OPENSSL_INSTALL_DIR")"

View File

@ -4,8 +4,8 @@ cd $(dirname $0)
ANDROID_SDK_ROOT=${1:-SDK}
ANDROID_NDK_VERSION=${2:-23.2.8568313}
if [ -d "$ANDROID_SDK_ROOT" ] ; then
echo "Error: directory \"$ANDROID_SDK_ROOT\" already exists. Delete it manually to proceed."
if [ -e "$ANDROID_SDK_ROOT" ] ; then
echo "Error: file or directory \"$ANDROID_SDK_ROOT\" already exists. Delete it manually to proceed."
exit 1
fi