Skip to content

Instantly share code, notes, and snippets.

@micbou
Last active August 25, 2016 22:04
Show Gist options
  • Save micbou/b73b7bb7244511d28b45ed4fc12f9ad5 to your computer and use it in GitHub Desktop.
Save micbou/b73b7bb7244511d28b45ed4fc12f9ad5 to your computer and use it in GitHub Desktop.
Update ycm_core library when needed
#!/usr/bin/env python
import os.path as p
import subprocess
import sys
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
DIR_OF_YCMD = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd' )
sys.path.insert( 1, DIR_OF_YCMD )
sys.path.insert( 1, p.join( DIR_OF_YCMD, 'ycmd' ) )
import server_utils
def Main():
if not server_utils.CompatibleWithCurrentCore():
print( 'The ycm_core library is up to date.' )
sys.exit()
build_file = p.join( DIR_OF_THIS_SCRIPT, 'install.py' )
python_binary = sys.executable
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
if __name__ == "__main__":
Main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment