Skip to content

Commit

Permalink
Fix qFlipper parser
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkbatya committed Nov 9, 2023
1 parent af0f2f3 commit b2a2cec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions indexer/src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ def parse(self, filename: str) -> None:

class qFlipperFileParser(FileParser):
def parse(self, filename: str) -> None:
regex = re.compile(r"^(qFlipper\w*)(-.+)*-([0-9.a]+)(-rc\d+)?\.(\w+)$")
regex = re.compile(
r"^(qFlipper\w*)(-.+)*-([0-9.a]+(-rc\d+)?|(dev-\w+-\w+))\.(\w+)$"
)
match = regex.match(filename)
if not match:
return
arch = match.group(2)
extention = match.group(5)
extention = match.group(6)
if extention == "dmg":
target = "macos"
file_type = "dmg"
Expand All @@ -191,7 +193,7 @@ def parse(self, filename: str) -> None:
if arch in ["64bit", "x86_64"]:
jsonArch = "amd64"
else:
raise Exception(f"Cannot parse target")
raise Exception(f"Cannot parse target, arch = {arch}")
self.target = target + "/" + jsonArch
self.type = file_type

Expand Down

0 comments on commit b2a2cec

Please sign in to comment.