Skip to content

Commit caacc86

Browse files
committed
Fix tmp directory in docker container
1 parent 8d58d53 commit caacc86

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
2222

2323
# Install git
2424
RUN apt-get update \
25-
&& apt-get install -y --no-install-recommends git \
25+
&& apt-get install -y --no-install-recommends git curl\
2626
&& rm -rf /var/lib/apt/lists/*
2727

2828
WORKDIR /app

src/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MAX_DISPLAY_SIZE: int = 300_000
2-
TMP_BASE_PATH: str = "../tmp"
2+
TMP_BASE_PATH: str = "/tmp/gitingest"
33

44
EXAMPLE_REPOS: list[dict[str, str]] = [
55
{"name": "Gitingest", "url": "https://github.com/cyclotruc/gitingest"},

src/gitingest/ingest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import inspect
33
import shutil
4-
from pathlib import Path
54

65
from gitingest.clone import CloneConfig, clone_repo
76
from gitingest.ingest_from_query import ingest_from_query
@@ -79,10 +78,9 @@ def ingest(
7978
f.write(tree + "\n" + content)
8079

8180
return summary, tree, content
82-
8381
finally:
8482
# Clean up the temporary directory if it was created
8583
if query["url"]:
86-
# Get parent directory two levels up from local_path (../tmp)
87-
cleanup_path = str(Path(query["local_path"]).parents[1])
84+
# Clean up the temporary directory under /tmp/gitingest
85+
cleanup_path = "/tmp/gitingest"
8886
shutil.rmtree(cleanup_path, ignore_errors=True)

src/gitingest/parse_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from gitingest.exceptions import InvalidPatternError
99
from gitingest.ignore_patterns import DEFAULT_IGNORE_PATTERNS
1010

11-
TMP_BASE_PATH: str = "../tmp"
11+
TMP_BASE_PATH: str = "/tmp/gitingest"
1212
HEX_DIGITS = set(string.hexdigits)
1313

1414

0 commit comments

Comments
 (0)