Skip to content
Open
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
1 change: 1 addition & 0 deletions Project-Explainer
Submodule Project-Explainer added at 3af021
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A python module that is capable of providing different levels of summary for the
#### Installation

```
pip install git+https://github.com/c2siorg/Project-Explainer.git@main#subdirectory=project_explainer&egg=gh_explainer
pip install -r project_explainer/requirements.txt
```

#### Example usage
Expand Down
2 changes: 2 additions & 0 deletions project_explainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-e git+https://github.com/c2siorg/Project-Explainer.git@main#subdirectory=project_explainer&egg=gh_explainer&egg=gh_explainer
-e git+https://github.com/c2siorg/Project-Explainer.git@main#subdirectory=project_processor&egg=gh_processor
17 changes: 14 additions & 3 deletions project_processor/gh_processor/github_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ def download_github_repo(repo_url: str, branch: str = "main") -> str:
Returns:
repo_path (str): Absolute path to downloaded repo
"""



repo_name = repo_url.split("/")[-1].split(".")[0]
repo_path = os.path.abspath(repo_name)

Repo.clone_from(repo_url, repo_name, branch=branch)
# Check if the repository directory already exists
if os.path.exists(repo_path):
logger.info(f"Repository '{repo_name}' already exists at '{repo_path}'. Skipping cloning.")
return repo_path

else:

Repo.clone_from(repo_url, repo_name, branch=branch)

logger.info(f"Repository '{repo_name}' downloaded successfully! and repo path {repo_path}")
return repo_path

logger.info(f"Repository '{repo_name}' downloaded successfully!")
return repo_path