Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the install script to python
Translate the install.sh script in python to make it platform independent. Keep install.sh as a wrapper of install.py to not break scripts that depend on it.
- Loading branch information
Showing
2 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
import os.path as p | ||
import glob | ||
|
||
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) ) | ||
DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' ) | ||
|
||
|
||
def Main(): | ||
build_file = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' ) | ||
|
||
if not p.isfile( build_file ): | ||
sys.exit( 'File ' + build_file + ' does not exist; you probably forgot ' | ||
'to run:\n\tgit submodule update --init --recursive\n\n' ) | ||
|
||
python_binary = sys.executable | ||
args = ' '.join( sys.argv[1:] ) | ||
subprocess.call( ' '.join( [ python_binary, build_file, args ] ) ) | ||
|
||
# Remove old YCM libs if present so that YCM can start. | ||
old_libs = ( | ||
glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_core.*' ) ) + | ||
glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_client_support.*' ) ) + | ||
glob.glob( p.join( DIR_OF_OLD_LIBS, '*clang*.*') ) ) | ||
for lib in old_libs: | ||
os.remove( lib ) | ||
|
||
if __name__ == "__main__": | ||
Main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters