<reponame>LeetSquad/Swarm-nbzz
import click


@click.command("init", short_help="Create or migrate the configuration")
@click.option(
    "--create-certs",
    "-c",
    default=None,
    help="Create new SSL certificates based on CA in [directory]",
    type=click.Path(),
)
@click.pass_context
def init_cmd(ctx: click.Context, create_certs: str):
    """
    Create a new configuration or migrate from previous versions to current
    Get more details on Nbzz wiki:
      https://github.com/Nbzz-Network/nbzz-blockchain/wiki/Farming-on-many-machines
    """
    from pathlib import Path
    from .init_funcs import init

    init(Path(create_certs) if create_certs is not None else None, ctx.obj["root_path"])


if __name__ == "__main__":
    from .init_funcs import nbzz_init
    from nbzz.util.default_root import DEFAULT_ROOT_PATH

    nbzz_init(DEFAULT_ROOT_PATH)

import click


@click.command("init", short_help="Create or migrate the configuration")
@click.option(
    "--create-certs",
    "-c",
    default=None,
    help="Create new SSL certificates based on CA in [directory]",
    type=click.Path(),
)
@click.pass_context
def init_cmd(ctx: click.Context, create_certs: str):
    """
    Create a new configuration or migrate from previous versions to current
    Get more details on Nbzz wiki:
      https://github.com/Nbzz-Network/nbzz-blockchain/wiki/Farming-on-many-machines
    """
    from pathlib import Path
    from .init_funcs import init

    init(Path(create_certs) if create_certs is not None else None, ctx.obj["root_path"])


if __name__ == "__main__":
    from .init_funcs import nbzz_init
    from nbzz.util.default_root import DEFAULT_ROOT_PATH

    nbzz_init(DEFAULT_ROOT_PATH)
Create a new configuration or migrate from previous versions to current
     Get more details on Nbzz wiki:
       https://github.com/Nbzz-Network/nbzz-blockchain/wiki/Farming-on-many-machines