Skip to content

Commit

Permalink
fix: 🐛 fixes latest version check issue
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Vieira <[email protected]>
  • Loading branch information
lucasvmx committed Mar 29, 2022
1 parent ec241f4 commit 3060284
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tools/updater/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Lucas Vieira <[email protected]>
#

from status_codes import ALREADY_UPDATED
from status_codes import ALREADY_UPDATED, UPDATE_FAILED
from download import download_latest_version
from urllib.parse import urlparse
from urllib.request import urlopen
Expand Down Expand Up @@ -57,8 +57,8 @@ def get_latest_version():


return major, minor, patch
except Exception as err:
return 0, 0, 0
except Exception:
raise


if __name__ == "__main__":
Expand All @@ -74,7 +74,12 @@ def get_latest_version():
major, minor, patch = parse_version_string(args["current_version"])

# Obtém a versão mais recente do programa
latest_major, latest_minor, latest_patch = get_latest_version()
try:
global latest_major, latest_minor, latest_patch
latest_major, latest_minor, latest_patch = get_latest_version()
except Exception as err:
print(f"[ERROR] Could not fetch latest version: {err}")
exit(UPDATE_FAILED)

# Compara as versões
curr_ver = major * 100 + minor * 10 + patch
Expand Down

0 comments on commit 3060284

Please sign in to comment.