2013-02-06 13:16:49 -03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2014-09-29 12:03:06 -07:00
|
|
|
set -e
|
|
|
|
|
2014-05-13 16:12:52 -07:00
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2013-04-09 18:36:59 -07:00
|
|
|
|
2015-01-17 17:48:30 -08:00
|
|
|
build_file=$SCRIPT_DIR/third_party/ycmd/build.py
|
2014-05-15 19:21:04 -07:00
|
|
|
|
|
|
|
if [[ ! -f "$build_file" ]]; then
|
|
|
|
echo "File $build_file doesn't exist; you probably forgot to run:"
|
|
|
|
printf "\n\tgit submodule update --init --recursive\n\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-01-18 10:10:23 -08:00
|
|
|
command_exists() {
|
|
|
|
command -v "$1" >/dev/null 2>&1 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
PYTHON_BINARY=python
|
|
|
|
if command_exists python2; then
|
|
|
|
PYTHON_BINARY=python2
|
|
|
|
fi
|
|
|
|
|
|
|
|
$PYTHON_BINARY "$build_file" "$@"
|
2014-05-14 15:00:59 -07:00
|
|
|
|
|
|
|
# Remove old YCM libs if present so that YCM can start.
|
2014-05-15 09:54:41 -07:00
|
|
|
rm -f python/*ycm_core.* &> /dev/null
|
|
|
|
rm -f python/*ycm_client_support.* &> /dev/null
|
|
|
|
rm -f python/*clang*.* &> /dev/null
|