narasimha01tm commited on
Commit
e99baf8
·
verified ·
1 Parent(s): d783c06

Deploy backend to Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. app/agents/github_import.py +10 -0
app/agents/github_import.py CHANGED
@@ -58,6 +58,16 @@ class RepoSummary:
58
  local_path: str = ""
59
 
60
 
 
 
 
 
 
 
 
 
 
 
61
  def _detect_language(code_files: list[CodeFile]) -> str:
62
  counts: dict[str, int] = {}
63
  for f in code_files:
 
58
  local_path: str = ""
59
 
60
 
61
+ def cleanup_clone(local_path: str) -> None:
62
+ """Clean up cloned temporary directory if it exists."""
63
+ if local_path and os.path.exists(local_path):
64
+ try:
65
+ shutil.rmtree(local_path, ignore_errors=True)
66
+ logger.info("cleaned_up_clone", path=local_path)
67
+ except Exception as e:
68
+ logger.warning("cleanup_clone_failed", path=local_path, error=str(e))
69
+
70
+
71
  def _detect_language(code_files: list[CodeFile]) -> str:
72
  counts: dict[str, int] = {}
73
  for f in code_files: