aider: Added functionality to send commits to public repos.
# Context: USER: what package can we use to be able to send commits to public repos?
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import giturlparse
|
||||
import git
|
||||
|
||||
class PublicGitRepo:
|
||||
"""replaces the text in the given text string with a given other text at some key positions"""
|
||||
@@ -16,8 +17,15 @@ class PublicGitRepo:
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "validate_git_repo_url"
|
||||
|
||||
def validate_git_repo_url(self,**kwargs):
|
||||
def validate_git_repo_url(self, **kwargs):
|
||||
git_url = kwargs.get("url", None)
|
||||
parsed_url = giturlparse.parse(git_url)
|
||||
|
||||
return (git_url,)
|
||||
|
||||
def send_commit(self, repo_path, commit_message):
|
||||
repo = git.Repo(repo_path)
|
||||
repo.git.add(all=True)
|
||||
repo.index.commit(commit_message)
|
||||
repo.remotes.origin.push()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user