2015-08-20 01:28:32 -04:00
|
|
|
#!/bin/sh
|
2013-02-06 11:16:49 -05:00
|
|
|
|
2015-08-20 01:28:32 -04:00
|
|
|
SCRIPT_DIR=$(dirname $0 || exit $?)
|
|
|
|
cd $SCRIPT_DIR || exit $?
|
2013-04-09 21:36:59 -04:00
|
|
|
|
2015-01-17 20:48:30 -05:00
|
|
|
build_file=$SCRIPT_DIR/third_party/ycmd/build.py
|
2014-05-15 22:21:04 -04:00
|
|
|
|
2015-08-20 01:28:32 -04:00
|
|
|
if [ ! -f "$build_file" ]; then
|
2014-05-15 22:21:04 -04:00
|
|
|
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 13:10:23 -05:00
|
|
|
command_exists() {
|
|
|
|
command -v "$1" >/dev/null 2>&1 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
PYTHON_BINARY=python
|
|
|
|
if command_exists python2; then
|
|
|
|
PYTHON_BINARY=python2
|
|
|
|
fi
|
|
|
|
|
2015-08-20 01:28:32 -04:00
|
|
|
$PYTHON_BINARY "$build_file" "$@" || exit $?
|
2014-05-14 18:00:59 -04:00
|
|
|
|
|
|
|
# Remove old YCM libs if present so that YCM can start.
|
2014-05-15 12:54:41 -04:00
|
|
|
rm -f python/*ycm_core.* &> /dev/null
|
|
|
|
rm -f python/*ycm_client_support.* &> /dev/null
|
|
|
|
rm -f python/*clang*.* &> /dev/null
|