add-resume #12
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue