Skip to content
Snippets Groups Projects
Commit f1bbe0e9 authored by r.jaepel's avatar r.jaepel
Browse files

Fix CLI remote create command

parent 8fee63d5
No related branches found
No related tags found
No related merge requests found
...@@ -101,18 +101,17 @@ def add_remote(name: str = None, remote_url: str = None): ...@@ -101,18 +101,17 @@ def add_remote(name: str = None, remote_url: str = None):
@remote.command(name="create") @remote.command(name="create")
@click.option("-p", '--path_to_repo', default=".",
help='Path to repository to which the remote is added. Default is cwd.')
@click.argument('url') @click.argument('url')
@click.argument('namespace') @click.argument('namespace')
@click.argument('name') @click.argument('name')
def create_remotes(url, namespace, name): @click.argument('username')
def create_remotes(url, namespace, name, username=None):
if username is None:
username = namespace
from cadetrdm.repositories import ProjectRepo from cadetrdm.repositories import ProjectRepo
repo = ProjectRepo(".") repo = ProjectRepo(".")
if "github" in url: repo.create_remotes(name=name, namespace=namespace, url=url, username=username)
repo.create_github_remotes(namespace=namespace, name=name)
else:
repo.create_gitlab_remotes(url=url, namespace=namespace, name=name)
@remote.command(name="list") @remote.command(name="list")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment