Skip to content

Commit

Permalink
Improved check for gamefix filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
Root-Core committed Sep 8, 2024
1 parent 0301db4 commit f961ae0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/scripts/check_gamefixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,22 @@ def check_filenames(root: Path) -> None:
file
for file in root.glob('gamefixes-*/*.py')
if not file.name.startswith(('__init__.py', 'default.py', 'winetricks-gui.py'))
and not file.parent.name.startswith('gamefixes-steam')
]

print('Checking for expected file names...', file=sys.stderr)
for module in gamefixes:
print(f'{module.parent.name}/{module.name}', file=sys.stderr)
if module.exists() and not module.name.startswith('umu-'):
err = f'The following file does not start with "umu-": {module}'
if not module.exists():
err = f'The following file does not exist: {module.parent.name}/{module}'
raise FileNotFoundError(err)
elif module.parent.name.startswith('gamefixes-steam'):
if module.stem.isnumeric():
continue
err = f'The following Steam fix filename is invalid: {module}'
raise ValueError(err)
elif not module.name.startswith('umu-'):
err = f'The following file does not start with "umu-": {module}'
raise ValueError(err)


def main() -> None:
Expand Down

0 comments on commit f961ae0

Please sign in to comment.