Skip to content

Commit

Permalink
Fix: Windows git error.
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Oct 6, 2023
1 parent 9ee5dec commit 5b66995
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "readmeai"
version = "0.4.04"
version = "0.4.06"
description = "🚀 Generate beautiful README.md files from the terminal. Powered by OpenAI's GPT LLMs 💫"
authors = ["Eli <[email protected]>"]
license = "MIT"
Expand Down
Empty file added readmeai/md_builder/__init__.py
Empty file.
18 changes: 9 additions & 9 deletions readmeai/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

def clone_repo_to_temp_dir(repo_path: str) -> Path:
"""Clone a repository to a temporary directory and remove the .git directory."""
git_exec_path = find_git_executable()
validate_git_executable(git_exec_path)
# git_exec_path = find_git_executable()
# validate_git_executable(git_exec_path)

env = os.environ.copy()
env["GIT_PYTHON_GIT_EXECUTABLE"] = str(git_exec_path)
# env = os.environ.copy()
# env["GIT_PYTHON_GIT_EXECUTABLE"] = str(git_exec_path)

temp_dir = tempfile.mkdtemp()
try:
git.Repo.clone_from(repo_path, temp_dir, env=env)
git_dir = Path(temp_dir) / ".git"
git.Repo.clone_from(repo_path, temp_dir, depth=1)

if git_dir.exists():
shutil.rmtree(git_dir)
# git_dir = Path(temp_dir) / ".git"
# if git_dir.exists():
# shutil.rmtree(git_dir)

return Path(temp_dir)

Expand Down Expand Up @@ -104,7 +104,7 @@ def get_user_repository_name(url_or_path) -> (str, str):
"""

if os.path.exists(url_or_path):
return os.path.basename(url_or_path), "local"
return os.path.basename(url_or_path)

patterns = {
"github": r"https?://github.com/([^/]+)/([^/]+)",
Expand Down

0 comments on commit 5b66995

Please sign in to comment.