mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
only remove wakatime-cli after finished downloading new one
This commit is contained in:
parent
bebb46dda6
commit
e5331d3086
12
WakaTime.py
12
WakaTime.py
@ -626,18 +626,18 @@ class DownloadCLI(threading.Thread):
|
||||
if not os.path.exists(RESOURCES_FOLDER):
|
||||
os.makedirs(RESOURCES_FOLDER)
|
||||
|
||||
if isCliInstalled():
|
||||
try:
|
||||
os.remove(getCliLocation())
|
||||
except:
|
||||
log(DEBUG, traceback.format_exc())
|
||||
|
||||
try:
|
||||
url = cliDownloadUrl()
|
||||
log(DEBUG, 'Downloading wakatime-cli from {url}'.format(url=url))
|
||||
zip_file = os.path.join(RESOURCES_FOLDER, 'wakatime-cli.zip')
|
||||
download(url, zip_file)
|
||||
|
||||
if isCliInstalled():
|
||||
try:
|
||||
os.remove(getCliLocation())
|
||||
except:
|
||||
log(DEBUG, traceback.format_exc())
|
||||
|
||||
log(INFO, 'Extracting wakatime-cli...')
|
||||
with ZipFile(zip_file) as zf:
|
||||
zf.extractall(RESOURCES_FOLDER)
|
||||
|
Loading…
Reference in New Issue
Block a user