From 4742a4b6684a0f423876ecdef0a183ff0d86f408 Mon Sep 17 00:00:00 2001 From: Balint Haller Date: Mon, 1 Mar 2021 22:26:02 +0100 Subject: [PATCH] main: fix lint --- carte_cli/main.py | 10 +++++++--- carte_cli/scaffolding/frontend.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/carte_cli/main.py b/carte_cli/main.py index 443eddc..db16457 100644 --- a/carte_cli/main.py +++ b/carte_cli/main.py @@ -47,9 +47,13 @@ def run_extraction( @app.command("new") def new_frontend( - name: str = typer.Argument(..., help="The name of the front end folder to create"), - no_admin: bool = typer.Option(False, "--no-admin", help="Disable admin for editing metadata"), - no_sample: bool = typer.Option(False, "--no-sample", help="Don't initialise sample data") + name: str = typer.Argument(..., help="The name of the front end folder to create"), + no_admin: bool = typer.Option( + False, "--no-admin", help="Disable admin for editing metadata" + ), + no_sample: bool = typer.Option( + False, "--no-sample", help="Don't initialise sample data" + ), ): create_frontend_dir(name, init_admin=(not no_admin), sample_data=(not no_sample)) diff --git a/carte_cli/scaffolding/frontend.py b/carte_cli/scaffolding/frontend.py index 36c0745..ac354db 100644 --- a/carte_cli/scaffolding/frontend.py +++ b/carte_cli/scaffolding/frontend.py @@ -9,15 +9,19 @@ CARTE_FRONTEND_REPO = "https://github.com/carte-data/carte-frontend.git" APP_NAME = "my-super-cli-app" + def run_command(args: List[str]): subprocess.run(args) + def clone_repo(target: str): run_command(["git", "clone", "--depth", "1", CARTE_FRONTEND_REPO, target]) + def remove_origin(): run_command(["git", "remote", "rm", "origin"]) + def create_frontend_dir(target: str, init_admin: bool = True, sample_data: bool = True): typer.echo("Cloning front end template...") clone_repo(target)