Skip to content

Commit

Permalink
Create reset for persistent session
Browse files Browse the repository at this point in the history
  • Loading branch information
Navarro-Jonathan committed Aug 10, 2023
1 parent f7de8d2 commit e2c84a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/aerie_cli/commands/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,5 @@ def delete_all_files(

delete_all_persistent_files()
# Update the PersistentConfigurationManager's cached configurations to account for the clean
PersistentSessionManager.unset_active_session()
PersistentSessionManager.reset()
PersistentConfigurationManager.reset()
13 changes: 13 additions & 0 deletions src/aerie_cli/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ def unset_active_session(cls) -> str:
cls._active_session = None
return name

@classmethod
def reset(cls) -> None:
cls._active_session = None

# Get any/all open sessions. List in chronological order, newest first
fs: List[Path] = [
f for f in SESSION_FILE_DIRECTORY.glob('*.aerie_cli.session')]
if not len(fs):
return
# Delete all session files
for fn in fs:
fn.unlink()


class NoActiveSessionError(Exception):
pass

0 comments on commit e2c84a1

Please sign in to comment.