add-resume #12

Merged
dan merged 7 commits from add-resume into dev 2023-12-07 19:38:19 +01:00
Showing only changes of commit 9a06276554 - Show all commits

View file

@ -76,3 +76,10 @@ class DirManager:
env_file = next(self.ENV_FILES.glob(f"*{search_string}*"))
config: dict[str, str] = dotenv_values(env_file) # type: ignore
return config
@staticmethod
def get_latest_session_id(output_dir: Path) -> str:
"""returns the name of the newest dir inside of output_dir"""
all_dirs = [d for d in output_dir.iterdir() if d.is_dir()]
newest_dir: Path = max(all_dirs, key=lambda x: x.stat().st_ctime)
return newest_dir.name