odoo-openupgrade-wizard/odoo_openupgrade_wizard/cli/cli_get_code.py
2022-06-27 01:57:31 +02:00

29 lines
835 B
Python

import click
from odoo_openupgrade_wizard.cli.cli_options import (
get_odoo_versions_from_options,
versions_options,
)
from odoo_openupgrade_wizard.tools.tools_odoo import get_odoo_env_path
from odoo_openupgrade_wizard.tools.tools_system import git_aggregate
@click.command()
@versions_options
@click.option(
"-j",
"--jobs",
type=int,
default=10,
help="Jobs used to call the git-aggregate command."
" reasonably set to 10 by default.",
)
@click.pass_context
def get_code(ctx, versions, jobs):
"""Get code by running gitaggregate command for each version"""
for odoo_version in get_odoo_versions_from_options(ctx, versions):
folder_path = get_odoo_env_path(ctx, odoo_version)
repo_file_path = folder_path / "repos.yml"
git_aggregate(folder_path, repo_file_path, jobs)