Skip to content

Commit dad0c10

Browse files
authored
Merge pull request #477 from ElcanoTek/claude/delete-cache-folders-8pG3i
Delete .crush and .local cache folders before starting crush
2 parents 4bdad9a + c4ece3e commit dad0c10

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

victoria_terminal.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,19 @@ def remove_local_duckdb(app_home: Path = APP_HOME) -> None:
824824
warn(f"Could not remove {db_path}: {exc}")
825825

826826

827+
def remove_cache_folders(app_home: Path = APP_HOME) -> None:
828+
"""Remove .crush and .local cache folders so each run starts fresh."""
829+
cache_dirs = [".crush", ".local"]
830+
for dir_name in cache_dirs:
831+
dir_path = app_home / dir_name
832+
try:
833+
if dir_path.exists():
834+
shutil.rmtree(dir_path)
835+
info(f"Removed cache folder: {dir_path}")
836+
except Exception as exc: # pragma: no cover - best effort cleanup
837+
warn(f"Could not remove {dir_path}: {exc}")
838+
839+
827840
def preflight_crush() -> None:
828841
"""Validate that Crush can be launched."""
829842
section("System preflight check")
@@ -934,6 +947,7 @@ def main(argv: Sequence[str] | None = None) -> None:
934947
if not task_mode:
935948
banner_sequence()
936949

950+
remove_cache_folders(app_home)
937951
ensure_app_home(app_home)
938952
if args.accept_license:
939953
_persist_license_acceptance(app_home=app_home)

0 commit comments

Comments
 (0)