Skip to content

Commit 30f9fef

Browse files
committed
check_files: accomodate for files in subdirectories
1 parent 43f4ceb commit 30f9fef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/check_files.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,22 @@
1515
with open(f"../entries/{game}/game.json") as f:
1616
game = json.load(f)
1717
# print(f"Checking {game['slug']}..")
18+
base_dir = f"{path}/{game['slug']}"
19+
1820
for file in game["files"]:
19-
if file["filename"] not in os.listdir(f"{path}/{game['slug']}"):
21+
full_path = os.path.join(base_dir, file["filename"])
22+
if not os.path.isfile(full_path):
2023
raise Exception(
2124
f'{file["filename"]} found in manifest but not on disk (entry {game["slug"]})'
2225
)
26+
2327
for screenshot in game["screenshots"]:
24-
if screenshot not in os.listdir(f"{path}/{game['slug']}"):
28+
full_path = os.path.join(base_dir, screenshot)
29+
if not os.path.isfile(full_path):
2530
raise Exception(
2631
f'{screenshot} found in manifest but not on disk (entry {game["slug"]})'
2732
)
33+
2834
# print(
2935
# f"{game['slug']}: {len(game['files'])} file(s), {len(game['screenshots'])} screenshot(s)"
3036
# )

0 commit comments

Comments
 (0)