Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
""" Configuration file for the project. """

from pathlib import Path

MAX_DISPLAY_SIZE: int = 300_000
TMP_BASE_PATH: str = "/tmp/gitingest"
TMP_BASE_PATH = Path("/tmp/gitingest")
DELETE_REPO_AFTER: int = 60 * 60 # In seconds

EXAMPLE_REPOS: list[dict[str, str]] = [
Expand Down
8 changes: 4 additions & 4 deletions src/gitingest/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import inspect
import shutil

from config import TMP_BASE_PATH
from gitingest.clone import CloneConfig, clone_repo
from gitingest.ingest_from_query import ingest_from_query
from gitingest.parse_query import parse_query
Expand Down Expand Up @@ -63,7 +64,7 @@ def ingest(
# Extract relevant fields for CloneConfig
clone_config = CloneConfig(
url=query["url"],
local_path=query["local_path"],
local_path=str(query["local_path"]),
commit=query.get("commit"),
branch=query.get("branch"),
)
Expand All @@ -84,6 +85,5 @@ def ingest(
finally:
# Clean up the temporary directory if it was created
if query["url"]:
# Clean up the temporary directory under /tmp/gitingest
cleanup_path = "/tmp/gitingest"
shutil.rmtree(cleanup_path, ignore_errors=True)
# Clean up the temporary directory
shutil.rmtree(TMP_BASE_PATH, ignore_errors=True)
Loading
Loading