Skip to content

Commit

Permalink
Merge pull request #12 from nomike/Fix-templatehelper.getlastmodified…
Browse files Browse the repository at this point in the history
…file()

Fix path building in templatehelper.getlastmodifiedfile(). Improve assertion error message.
  • Loading branch information
nomike authored Sep 18, 2024
2 parents 3aa6cb5 + 561e359 commit d5703b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templatehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def getlastmodifiedfile(path):
Recursively search for the newest file in the specified directory.
"""

path = os.path.join('..', path)
assert os.path.isdir(path)
path = os.path.join('.', path)
assert os.path.isdir(path), f'{path} is not a directory!'
newest = {"file": path, "timestamp": os.path.getmtime(path)}
for root, dirs, files in os.walk(path):
for directory in dirs:
Expand Down

0 comments on commit d5703b9

Please sign in to comment.