-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
23 lines (18 loc) · 972 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import argparse
from src.pipeline import add_new_folders, generate_commits
from src.git_operations import git_push
GREEN = "\033[92m"
RESET = "\033[0m"
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate commit messages for modified files in a git repository.")
parser.add_argument("repo_path", help="Path to the git repository")
parser.add_argument("--file", nargs='+', help="Specific files to generate commits for")
parser.add_argument("--ignore", nargs='+', help="Specific files to ignore")
parser.add_argument("--push", help="Branch name to push the changes")
args = parser.parse_args()
add_new_folders(args.repo_path)
generate_commits(args.repo_path, args.file, args.ignore)
if args.push:
print(f"{GREEN}Pushing changes to branch {args.push}...{RESET}")
git_push(args.repo_path, args.push)
print(f"{GREEN}Changes are successfully pushed to branch {args.push}.{RESET}")