[F] Lowercase distro detection

This commit is contained in:
Hykilpikonna 2022-12-11 07:02:54 -05:00
parent adc947cecd
commit 485aa44f3f
No known key found for this signature in database
GPG key ID: 256CD01A41D7FA26
2 changed files with 278 additions and 274 deletions

File diff suppressed because it is too large Load diff

View file

@ -104,7 +104,9 @@ def match_condition(match: str) -> str:
match = [s.strip() for s in match.split("|")] match = [s.strip() for s in match.split("|")]
conds = [] conds = []
for m in match: for m in match:
stripped = m.strip("*'\"") stripped = m.strip("*'\"").lower()
if '*' in stripped or '"' in stripped:
print(f"TODO: Cannot properly parse: {m}")
# Exact matches # Exact matches
if m.strip("*") == m: if m.strip("*") == m:
@ -162,6 +164,7 @@ def export_distros():
from ..distro import AsciiArt from ..distro import AsciiArt
def detect(name: str) -> AsciiArt: def detect(name: str) -> AsciiArt:
name = name.lower()
""" """
py += '\n'.join(export_distro(d).strip('\n') for d in distros) py += '\n'.join(export_distro(d).strip('\n') for d in distros)
write(Path(__file__).parent.parent / f'hyfetch/distros/distro_detector.py', py) write(Path(__file__).parent.parent / f'hyfetch/distros/distro_detector.py', py)