improving ndk installer script

This commit is contained in:
Mariotaku Lee 2015-11-26 11:12:16 +08:00
parent 74870e59a0
commit bcb385e136
1 changed files with 4 additions and 6 deletions

View File

@ -1,11 +1,14 @@
#!/bin/bash
project_dir=${OLDPWD}
project_dir=`pwd`
local_opt_dir="${HOME}/.local/opt"
ndk_name="android-ndk-r10e"
ndk_install_dest="${local_opt_dir}/${ndk_name}"
echo "Adding NDK install path to ${project_dir}"
echo "ndk.dir=${ndk_install_dest}" >> ${project_dir}/local.properties
if [ -d ${ndk_install_dest} ]; then
echo "NDK already installed in ${ndk_install_dest}"
exit
@ -20,7 +23,6 @@ cd ${local_opt_dir}
if [ `uname -m` = x86_64 ];
then
ndk_installer_name="${ndk_name}-linux-x86_64.bin"
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O ndk.bin
else
ndk_installer_name="${ndk_name}-linux-x86.bin"
fi
@ -38,7 +40,3 @@ echo "Installing NDK installer ${ndk_installer_name}"
echo "Removing installed NDK installer ${ndk_installer_name}"
rm ${ndk_installer_name}
echo "Adding NDK install path to ${project_dir}"
echo "ndk.dir=${ndk_install_dest}" >> ${project_dir}/local.properties