Checking for ANDROID_SDK_HOME and ANDROID_NDK_HOME variables before script execution

pull/25/head
Javernaut 5 years ago
parent 41ecdb2747
commit 2f85b4524c
  1. 3
      ffmpeg-android-maker.sh
  2. 16
      scripts/check-host-machine.sh

@ -18,6 +18,9 @@ export SCRIPTS_DIR=${BASE_DIR}/scripts
# All FFmpeg's libraries and headers are copied there
export OUTPUT_DIR=${BASE_DIR}/output
# Check the host machine for proper setup and fail fast otherwise
${SCRIPTS_DIR}/check-host-machine.sh || exit 1
# Directory to use as a place to build/install FFmpeg and its dependencies
BUILD_DIR=${BASE_DIR}/build
# Separate directory to build FFmpeg to

@ -0,0 +1,16 @@
#!/usr/bin/env bash
function checkVariablePresence() {
VARIABLE_NAME=$1
if [[ -z "${!VARIABLE_NAME}" ]]; then
echo "The ${VARIABLE_NAME} environment variable isn't defined"
echo $2
exit 1
fi
}
checkVariablePresence "ANDROID_SDK_HOME" \
"The variable should be set to the actual Android SDK path" || exit 1
checkVariablePresence "ANDROID_NDK_HOME" \
"The variable should be set to the actual Android NDK path" || exit 1
Loading…
Cancel
Save