From cb939dd8e26b53ba135587d150cfa4982f71f53d Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Thu, 24 Oct 2013 11:16:36 -0700 Subject: [PATCH] Adding a check for third_party libs present If the user forgot to checkout the submodules, then we bork during install.sh. --- install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install.sh b/install.sh index 3a5a2fe1..c771e4a5 100755 --- a/install.sh +++ b/install.sh @@ -106,6 +106,22 @@ function usage { exit 0 } +function check_third_party_libs { + libs_present=true + for folder in third_party/*; do + num_files_in_folder=$(find $folder -maxdepth 1 -mindepth 1 | wc -l) + if [[ $num_files_in_folder -eq 0 ]]; then + libs_present=false + fi + done + + if ! $libs_present; then + echo "Some folders in ./third_party are empty; you probably forgot to run:" + printf "\n\tgit submodule update --init --recursive\n\n" + exit 1 + fi +} + cmake_args="" omnisharp_completer=false for flag in $@; do @@ -130,6 +146,8 @@ if [[ $cmake_args == *-DUSE_SYSTEM_LIBCLANG=ON* ]] && \ usage fi +check_third_party_libs + if ! command_exists cmake; then echo "CMake is required to build YouCompleteMe." cmake_install