#!/usr/bin/env python3 import os import subprocess import argparse # Parse command-line arguments parser = argparse.ArgumentParser(description="Generate navigation entries for mkdocs.yml") parser.add_argument("--replace", action="store_true", help="Replace mkdocs.yml with new content") parser.add_argument("--COMMIT_MSG", help="Commit message for Git") args = parser.parse_args() # Get the commit message from command-line argument or prompt user if args.COMMIT_MSG: commit_msg = args.COMMIT_MSG else: commit_msg = input("Enter commit message: ") if not commit_msg.strip(): # Check if the input message is empty commit_msg = "Initial commit" # Set default commit message # Add changes to the staging area subprocess.run(["python3", "./scripts/list_new_docker_files.py", "--replace"], check=True) # Add changes to the staging area subprocess.run(["git", "add", "."], check=True) # Commit changes subprocess.run(["git", "commit", "-m", commit_msg], check=True) # Push changes subprocess.run(["git", "push"], check=True) print("Changes have been added, committed, and pushed.")