Skip to content

Commit 36f0613

Browse files
authored
Update update_commit.py
1 parent afe1732 commit 36f0613

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/update_commit.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
month = today.strftime("%b") # Get current month (e.g., Nov)
2020

2121
# Generate the filename based on the day of the month (e.g., 06(Nov) Root to leaf paths sum.md)
22-
# The name structure might differ but should follow a predictable pattern
2322
today_solution_filename = f"{day_of_month}({month})" # The pattern that matches the filename format.
2423

2524
# Make a request to GitHub to list files in the directory
@@ -32,6 +31,11 @@
3231

3332
files = response.json()
3433

34+
# Check if files are empty or response is not valid
35+
if isinstance(files, dict) and files.get('message') == 'Not Found':
36+
print(f"Directory not found: {dir_url}")
37+
sys.exit(1)
38+
3539
# Search for the correct file based on the date
3640
today_file = None
3741
for file in files:

0 commit comments

Comments
 (0)