Skip to content

Commit 156485e

Browse files
committed
sync-db: skip source folder when not found
1 parent 359b90d commit 156485e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/sync_db.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Those should point to the "entries" subfolder of a "Homebrew Hub database"
1717
# e.g.: https://github.com/gbdev/database or https://github.com/gbadev-org/games
1818

19-
basefolder = "db-sources/"
19+
basefolder = "db-sources"
2020

2121
dirs = [
2222
"database-gb/entries",
@@ -61,7 +61,11 @@ def run():
6161
folder = f"{basefolder}/{database_folder}"
6262
d += 1
6363
print(f"Processing folder {folder}")
64-
games = os.listdir(folder)
64+
try:
65+
games = os.listdir(folder)
66+
except FileNotFoundError:
67+
print("Folder not found, skipping it")
68+
continue
6569

6670
games_count = len(games)
6771
print(f"Found {games_count} games")

0 commit comments

Comments
 (0)