Ignore nonexistent git dates during local testing.

This commit is contained in:
voussoir 2023-06-25 21:27:34 -07:00
parent 2e42d40063
commit 5b72015278

View file

@ -85,9 +85,12 @@ def git_file_edited_date(path) -> datetime.datetime:
path,
]
date = check_output(command)
if date:
date = dateutil.parser.parse(date)
date = date.astimezone(datetime.timezone.utc)
return date
else:
return datetime.datetime.now(datetime.timezone.utc)
def git_file_commit_history(path):
'''
@ -134,9 +137,12 @@ def git_file_published_date(path) -> datetime.datetime:
path,
]
date = check_output(command)
if date:
date = dateutil.parser.parse(date)
date = date.astimezone(datetime.timezone.utc)
return date
else:
return datetime.datetime.now(datetime.timezone.utc)
# SOUP
################################################################################