erplibre/script/git_repo_update_group.py

53 lines
1.2 KiB
Python
Executable file

#!./.venv/bin/python
import os
import sys
import argparse
import logging
from git import Repo
import git
new_path = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.append(new_path)
from script.git_tool import GitTool
_logger = logging.getLogger(__name__)
def get_config():
"""Parse command line arguments, extracting the config file name,
returning the union of config file and command line arguments
:return: dict of config file settings and command line arguments
"""
config = GitTool.get_project_config()
# TODO update description
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""\
Update config.conf file with group specified in manifest file.
""",
epilog="""\
""",
)
parser.add_argument(
"--group",
default="",
help="Prod by default, use 'dev' for manifest/default.dev.xml",
)
args = parser.parse_args()
return args
def main():
config = get_config()
git_tool = GitTool()
filter_group = config.group if config.group else None
git_tool.generate_install_locally(filter_group=filter_group)
if __name__ == "__main__":
main()