Merge pull request #212 from puremourning/installer-windows
Fix windows installer issues - use symlinks not junctions and fix dum…
This commit is contained in:
commit
357e112cdf
2 changed files with 11 additions and 13 deletions
|
|
@ -170,7 +170,6 @@ function! vimspector#internal#job#StartCommandWithLog( cmd, category ) abort
|
||||||
\ a:cmd,
|
\ a:cmd,
|
||||||
\ {
|
\ {
|
||||||
\ 'out_io': 'buffer',
|
\ 'out_io': 'buffer',
|
||||||
\ 'in_io': 'null',
|
|
||||||
\ 'err_io': 'buffer',
|
\ 'err_io': 'buffer',
|
||||||
\ 'out_msg': 0,
|
\ 'out_msg': 0,
|
||||||
\ 'err_msg': 0,
|
\ 'err_msg': 0,
|
||||||
|
|
|
||||||
|
|
@ -59,14 +59,13 @@ def Print( *args, **kwargs ):
|
||||||
|
|
||||||
def CheckCall( *args, **kwargs ):
|
def CheckCall( *args, **kwargs ):
|
||||||
if options.quiet:
|
if options.quiet:
|
||||||
out = subprocess.PIPE
|
try:
|
||||||
|
subprocess.check_output( *args, stderr=subprocess.STDOUT, **kwargs )
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print( e.output.decode( 'utf-8' ) )
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
out = sys.stdout
|
subprocess.check_call( *args, **kwargs )
|
||||||
|
|
||||||
kwargs[ 'stdout' ] = out
|
|
||||||
kwargs[ 'stderr' ] = subprocess.STDOUT
|
|
||||||
|
|
||||||
subprocess.check_call( *args, **kwargs )
|
|
||||||
|
|
||||||
|
|
||||||
def PathToAnyWorkingPython3():
|
def PathToAnyWorkingPython3():
|
||||||
|
|
@ -477,7 +476,7 @@ def DownloadFileTo( url,
|
||||||
|
|
||||||
r = request.Request( url, headers = { 'User-Agent': 'Vimspector' } )
|
r = request.Request( url, headers = { 'User-Agent': 'Vimspector' } )
|
||||||
|
|
||||||
print( "Downloading {} to {}/{}".format( url, destination, file_name ) )
|
Print( "Downloading {} to {}/{}".format( url, destination, file_name ) )
|
||||||
|
|
||||||
if not check_certificate:
|
if not check_certificate:
|
||||||
context = ssl.create_default_context()
|
context = ssl.create_default_context()
|
||||||
|
|
@ -517,7 +516,7 @@ def ValidateCheckSumSHA256( file_path, checksum ):
|
||||||
|
|
||||||
def RemoveIfExists( destination ):
|
def RemoveIfExists( destination ):
|
||||||
if os.path.islink( destination ):
|
if os.path.islink( destination ):
|
||||||
Print( "Removing file {}".format( destination ) )
|
Print( "Removing link {}".format( destination ) )
|
||||||
os.remove( destination )
|
os.remove( destination )
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -533,8 +532,8 @@ def RemoveIfExists( destination ):
|
||||||
shutil.rmtree( BackupDir() )
|
shutil.rmtree( BackupDir() )
|
||||||
Print ( "OK, removed it" )
|
Print ( "OK, removed it" )
|
||||||
break
|
break
|
||||||
except OSError:
|
except OSError as e:
|
||||||
Print ( "FAILED" )
|
Print ( f"FAILED to remove {BackupDir()}: {e}" )
|
||||||
N = N + 1
|
N = N + 1
|
||||||
|
|
||||||
if os.path.exists( destination ):
|
if os.path.exists( destination ):
|
||||||
|
|
@ -609,7 +608,7 @@ def MakeSymlink( link, pointing_to, in_folder = None ):
|
||||||
link_path = os.path.abspath( link_path )
|
link_path = os.path.abspath( link_path )
|
||||||
if os.path.isdir( link_path ):
|
if os.path.isdir( link_path ):
|
||||||
os.rmdir( link_path )
|
os.rmdir( link_path )
|
||||||
CheckCall( [ 'cmd.exe', '/c', 'mklink', '/J', link_path, pointing_to ] )
|
CheckCall( [ 'cmd.exe', '/c', 'mklink', '/D', link_path, pointing_to ] )
|
||||||
else:
|
else:
|
||||||
os.symlink( pointing_to_relative, link_path )
|
os.symlink( pointing_to_relative, link_path )
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue