Skip to content

Commit

Permalink
main: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
balinthaller committed Mar 1, 2021
1 parent 18fef55 commit 4742a4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions carte_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 4 additions & 0 deletions carte_cli/scaffolding/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4742a4b

Please sign in to comment.