Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
check if variables are empty to be more failsafe
- Loading branch information
Showing
with
33 additions
and
15 deletions.
-
+33
−15
bootstrap.sh
|
|
@@ -21,6 +21,24 @@ TOX_CORE_DIR=libtoxcore-latest |
|
|
# if this script gets the parameter -t or --tox |
|
|
TOX_ONLY=false |
|
|
|
|
|
if [ -z "$BASE_DIR" ]; then |
|
|
echo "internal error detected!" |
|
|
echo "BASE_DIR should not be empty... aborting" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
if [ -z "$SODIUM_DIR" ]; then |
|
|
echo "internal error detected!" |
|
|
echo "SODIUM_DIR should not be empty... aborting" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
if [ -z "$TOX_CORE_DIR" ]; then |
|
|
echo "internal error detected!" |
|
|
echo "TOX_CORE_DIR should not be empty... aborting" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
########## check input parameters ########## |
|
|
@@ -34,27 +52,27 @@ if [ $# -ge 1 ] ; then |
|
|
fi |
|
|
|
|
|
# print help |
|
|
echo "Use this script to install/update libsodium and libtoxcore in ${INSTALL_DIR}" |
|
|
echo "" |
|
|
echo "usage:" |
|
|
echo " ${0} [-t|--tox|-h|--help]" |
|
|
echo "" |
|
|
echo "parameters:" |
|
|
echo " -h|--help: displays this help" |
|
|
echo " -t|--tox : only install/update libtoxcore" |
|
|
echo " requires an already installed libsodium" |
|
|
echo "" |
|
|
echo "example usages:" |
|
|
echo " ${0} -- to install libsodium and libtoxcore" |
|
|
echo " ${0} -t -- to update already installed libtoxcore" |
|
|
exit 1 |
|
|
echo "Use this script to install/update libsodium and libtoxcore in ${INSTALL_DIR}" |
|
|
echo "" |
|
|
echo "usage:" |
|
|
echo " ${0} [-t|--tox|-h|--help]" |
|
|
echo "" |
|
|
echo "parameters:" |
|
|
echo " -h|--help: displays this help" |
|
|
echo " -t|--tox : only install/update libtoxcore" |
|
|
echo " requires an already installed libsodium" |
|
|
echo "" |
|
|
echo "example usages:" |
|
|
echo " ${0} -- to install libsodium and libtoxcore" |
|
|
echo " ${0} -t -- to update already installed libtoxcore" |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
############### prepare step ############### |
|
|
# create INSTALL_DIR directory if necessary |
|
|
# create BASE_DIR directory if necessary |
|
|
mkdir -p ${BASE_DIR} |
|
|
|
|
|
# maybe an earlier run of this script failed |
|
|
|