Skip to content

Commit 96f758c

Browse files
committed
removed downgrading of ZIP versions again
1 parent bfb3ba3 commit 96f758c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

update.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import io
22
import os
33
import re
4-
from pathlib import Path
5-
64
import requests
75
import shutil
86
import subprocess
@@ -13,6 +11,7 @@
1311
from contextlib import closing
1412
from core import utils, COMMAND_LINE_ARGS
1513
from packaging import version
14+
from pathlib import Path
1615
from typing import Iterable
1716
from version import __version__
1817

@@ -138,7 +137,7 @@ def do_update_github() -> int:
138137
current_version = re.sub('^v', '', __version__)
139138
latest_version = re.sub('^v', '', response.json()[0]["tag_name"])
140139

141-
if version.parse(latest_version) != version.parse(current_version):
140+
if version.parse(latest_version) > version.parse(current_version):
142141
print('- Updating myself...')
143142

144143
zip_url = response.json()[0]['zipball_url']
@@ -176,10 +175,7 @@ def do_update_github() -> int:
176175
if rc.returncode:
177176
print(' => Autoupdate failed!')
178177
return -1
179-
if version.parse(latest_version) > version.parse(current_version):
180-
print(f' => DCSServerBot updated to the latest version {latest_version}.')
181-
else:
182-
print(f' => DCSServerBot reverted back to the previous version {latest_version}.')
178+
print(f' => DCSServerBot updated to the latest version {latest_version}.')
183179
else:
184180
print('- No update found for DCSServerBot.')
185181
return 0

0 commit comments

Comments
 (0)