Skip to content

Commit

Permalink
Update update_commit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunterdii authored Nov 6, 2024
1 parent afe1732 commit 36f0613
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/update_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
month = today.strftime("%b") # Get current month (e.g., Nov)

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

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

files = response.json()

# Check if files are empty or response is not valid
if isinstance(files, dict) and files.get('message') == 'Not Found':
print(f"Directory not found: {dir_url}")
sys.exit(1)

# Search for the correct file based on the date
today_file = None
for file in files:
Expand Down

0 comments on commit 36f0613

Please sign in to comment.