Skip to content

Commit

Permalink
get_proton_version(): Support new naming scheme of GE-Proton (trucker…
Browse files Browse the repository at this point in the history
  • Loading branch information
kakurasan authored Mar 1, 2022
1 parent 4bfbbf4 commit e958b90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions truckersmp_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def get_proton_version(protondir):
Examples:
"xxxxxxxxxx proton-5.13-6" -> (5, 13)
"xxxxxxxxxx 6.1-GE-2" -> (6, 1)
"xxxxxxxxxx GE-Proton7-4" -> (7, 0)
"xxxxxxxxxx proton-tkg-6.8.r15.gf308782d" -> (6, 8)
protondir: Proton top directory that has "version" file
Expand All @@ -319,6 +320,9 @@ def get_proton_version(protondir):
if "proton-tkg" in ver:
# 11 = len("proton-tkg") + 1
major, minor = ver[ver.index("proton-tkg") + 11:].split(".")[:2]
elif "GE-Proton" in ver:
# 9 = len("GE-Proton")
major, minor = (ver[ver.index("GE-Proton") + 9:ver.rindex("-")], 0)
else:
ver = ver.replace("proton-", "")
major, minor = ver[ver.index(" ") + 1:ver.index("-")].split(".")
Expand Down

0 comments on commit e958b90

Please sign in to comment.