forked from ycm-core/ycmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to go install, if that fails, go get
- Loading branch information
1 parent
fc0fb7e
commit ba5814d
Showing
1 changed file
with
15 additions
and
5 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 |
---|---|---|
|
@@ -254,6 +254,7 @@ def _CheckCallQuiet( args, status_message, **kwargs ): | |
def _CheckCall( args, **kwargs ): | ||
exit_message = kwargs.pop( 'exit_message', None ) | ||
stdout = kwargs.get( 'stdout', None ) | ||
on_failure = kwargs.pop( 'on_failure', None ) | ||
|
||
try: | ||
subprocess.check_call( args, **kwargs ) | ||
|
@@ -263,10 +264,12 @@ def _CheckCall( args, **kwargs ): | |
print( stdout.read().decode( 'utf-8' ) ) | ||
print( "FAILED" ) | ||
|
||
if exit_message: | ||
if on_failure: | ||
on_failure( exit_message, error.returncode ) | ||
elif exit_message: | ||
raise InstallationFailed( exit_message ) | ||
|
||
raise InstallationFailed( exit_code = error.returncode ) | ||
else: | ||
raise InstallationFailed( exit_code = error.returncode ) | ||
|
||
|
||
def GetGlobalPythonPrefix(): | ||
|
@@ -863,10 +866,17 @@ def EnableGoCompleter( args ): | |
new_env[ 'GOPATH' ] = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'go' ) | ||
new_env.pop( 'GOROOT', None ) | ||
new_env[ 'GOBIN' ] = p.join( new_env[ 'GOPATH' ], 'bin' ) | ||
CheckCall( [ go, 'get', 'golang.org/x/tools/[email protected]' ], | ||
|
||
gopls = 'golang.org/x/tools/[email protected]' | ||
CheckCall( [ go, 'install', gopls ], | ||
env = new_env, | ||
quiet = args.quiet, | ||
status_message = 'Building gopls for go completion' ) | ||
status_message = 'Building gopls for go completion', | ||
on_failure = lambda msg, code: CheckCall( | ||
[ go, 'get', gopls ], | ||
env = new_env, | ||
quiet = args.quiet, | ||
status_message = 'Trying legacy get get' ) ) | ||
|
||
|
||
def WriteToolchainVersion( version ): | ||
|