28 Commits

Author SHA1 Message Date
328e870bf0 finailising repo manager 2025-05-29 23:55:12 +10:00
546b86738a TODO: parse URL paramters correctly 2025-05-29 17:29:48 +10:00
1bb99c2343 change the .env to openthinkier as editor 2025-05-29 16:30:45 +10:00
=
c5444f1a7f merge is going to suck 2025-05-27 23:33:27 +10:00
=
4119b2ec41 fix dockerifle 2025-05-26 00:18:07 +10:00
=
01b7f1cd78 untested git stuff 2025-05-24 00:25:35 +10:00
c606f72d90 env vars and starting work on repo_manager 2025-05-23 15:47:25 +10:00
8a64d9c959 fix pyrefly typuing errors 2025-05-19 11:38:15 +10:00
0c090c8489 add vscode to gitignore 2025-05-19 11:28:10 +10:00
=
e0b2c80bc9 latest commits 2025-05-19 11:07:41 +10:00
=
44141ab545 pre attempt at langchain 2025-03-25 15:26:56 +10:00
=
e57d6eb6b6 getting gemma3 in the mix 2025-03-17 16:33:16 +10:00
=
c80f692cb0 update main.py 2025-02-27 09:44:19 +10:00
=
bc2f8a8bca move to vm 2025-02-27 09:41:01 +10:00
=
e7f7a79d86 integrating agentic chroma 2025-02-26 23:16:00 +10:00
=
9b11fea0e7 integrating agentic chroma 2025-02-26 23:13:27 +10:00
=
6320571528 set up chroma 2025-02-25 22:11:45 +10:00
=
c2ee21abfc playing with deepseek 2025-01-22 11:43:26 +11:00
20c2a7e335 testing 2024-11-26 00:20:03 +10:00
0314472620 build: Add REPO_OWNER and REPO_NAME 2024-11-23 21:52:17 +10:00
d9356fd4fa Here's an updated version of the script that includes error handling and better output formatting:
```python
import os
import sys
from git import Repo, GitCommandError

def clone_repo(repo_url, branch="main"):
    try:
        Repo.clone_from(repo_url, ".", branch=branch)
    except GitCommandError as e:
        print(f"Error cloning repository: {e}")
        sys.exit(1)

def create_markdown_file(file_name, content):
    try:
        with open(f"{file_name}.md", "w") as f:
            f.write(content)
    except IOError as e:
        print(f"Error creating Markdown file: {e}")
        sys.exit(1)

def commit_and_push(file_name, message):
    repo = Repo(".")
    try:
        repo.index.add([f"{file_name}.md"])
        repo.index.commit(message)
        repo.remote().push()
    except GitCommandError as e:
        print(f"Error committing and pushing changes: {e}")
        sys.exit(1)

def create_new_branch(branch_name):
    repo = Repo(".")
    try:
        repo.create_head(branch_name).checkout()
        repo.head.reference.set_tracking_url(
            f"https://your_git_server/{REPO_OWNER}/{REPO_NAME}.git/{branch_name}"
        )
        repo.remote().push()
    except GitCommandError as e:
        print(f"Error creating new branch: {e}")
        sys.exit(1)

if __name__ == "__main__":
    if len(sys.argv) < 3:
        print("Usage: python push_markdown.py <repo_url> <markdown_file_name>")
        sys.exit(1)

    repo_url = sys.argv[1]
    file_name = sys.argv[2]

    # Clone the repository
    clone_repo(repo_url)

    # Create a new Markdown file with content
    create_markdown_file(file_name, "Hello, World!\n")

    print(f"Created '{file_name}.md' successfully.")

    # Commit and push changes to the main branch
    commit_and_push(file_name, f"Add {file_name}.md")
    print("Changes committed and pushed to main branch.")

    # Create a new branch named after the Markdown file
    create_new_branch(file_name)
    print(f"Successfully created '{file_name}' branch with '{file_name}.md'.")
```

Now, the script includes error handling for cloning the repository, creating the Markdown file, committing and pushing changes, and creating a new branch. It also provides better output formatting by printing success messages after each step.

To use this updated script, run it from the command line like this:

```bash
python push_markdown.py https://your_git_server/username/repo.git my_new_file
```

This will clone the repository, create a new Markdown file named `my_new_file.md`, commit and push changes to the main branch, create a new branch named `my_new_file`, and print success messages for each step.
2024-11-23 21:50:26 +10:00
1bd0ae9b1b untested ollama 2024-11-14 17:48:11 +10:00
675c7d1701 feat: Create OllamaGenerator class for Pelican markdown generation 2024-11-13 22:41:53 +10:00
858f7c8d0a tril now gives me back a title and content of blogs 2024-11-12 23:29:11 +10:00
72a8428271 playing with tril api 2024-11-12 15:59:59 +10:00
bf40e4a3ca set up for proper repo crap 2024-11-11 20:23:18 +10:00
b72d422746 set up initial container 2024-11-07 17:42:47 +10:00
8d4bfc6e7e initial 2024-11-07 17:25:43 +10:00