mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
create symlink to wakatime-cli
This commit is contained in:
parent
e337afcc53
commit
66f5f48f33
24
WakaTime.py
24
WakaTime.py
@ -18,6 +18,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
import ssl
|
import ssl
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -652,6 +653,8 @@ class DownloadCLI(threading.Thread):
|
|||||||
except:
|
except:
|
||||||
log(DEBUG, traceback.format_exc())
|
log(DEBUG, traceback.format_exc())
|
||||||
|
|
||||||
|
createSymlink()
|
||||||
|
|
||||||
log(INFO, 'Finished extracting wakatime-cli.')
|
log(INFO, 'Finished extracting wakatime-cli.')
|
||||||
|
|
||||||
|
|
||||||
@ -903,3 +906,24 @@ def download(url, filePath):
|
|||||||
ssl._create_default_https_context = ssl._create_unverified_context
|
ssl._create_default_https_context = ssl._create_unverified_context
|
||||||
urlretrieve(url, filePath)
|
urlretrieve(url, filePath)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def createSymlink():
|
||||||
|
if is_win:
|
||||||
|
link = os.path.join(RESOURCES_FOLDER, 'wakatime-cli.exe')
|
||||||
|
if os.path.exists(link):
|
||||||
|
try:
|
||||||
|
os.remove(link)
|
||||||
|
except:
|
||||||
|
log(traceback.format_exc())
|
||||||
|
try:
|
||||||
|
shutil.copy2(getCliLocation(), link)
|
||||||
|
except:
|
||||||
|
log(traceback.format_exc())
|
||||||
|
else:
|
||||||
|
link = os.path.join(RESOURCES_FOLDER, 'wakatime-cli')
|
||||||
|
if not os.path.exists(link):
|
||||||
|
try:
|
||||||
|
os.symlink(getCliLocation(), link)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user