Skip to content

Commit

Permalink
add new argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarow committed Dec 27, 2024
1 parent 0e3d859 commit 7bb153b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ogdc_runner/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
from ogdc_runner.recipe.simple import make_simple_workflow


# TODO: How do we handle e.g. GitHub URL to recipe?
# handling github by
# checking if path is a URL
def is_url(recipe_path):
""" Check if the path is a valid URL."""
parsed = urlparse(recipe_path)
return parsed.scheme in ('http', 'https') and parsed.netloc != ''


def convert_url_to_ssh(recipe_path):
""" Convert https github url to ssh format."""
parsed = urlparse(recipe_path)
Expand All @@ -30,6 +30,7 @@ def convert_url_to_ssh(recipe_path):
repo_path = parsed.path.lstrip("/")
return f"[email protected]:{repo_path}.git"


def clone_repo(ssh_url):
"""Clone the repository into a temporary directory."""
temp_dir = tempfile.mkdtemp()
Expand Down Expand Up @@ -57,7 +58,8 @@ def clone_repo(ssh_url):
recipe_name = click.argument(
"recipe_name",
required=False,
type = str)
type = str
)


@click.group
Expand Down Expand Up @@ -101,7 +103,8 @@ def check_workflow_status(workflow_name: str) -> None:

@cli.command
@recipe_path
def submit_and_wait(recipe_path: Path) -> None:
@recipe_name
def submit_and_wait(recipe_path, recipe_name=None) -> None:
"""Submit a recipe to OGDC for execution and wait until completion."""
workflow_name = _submit_workflow(recipe_path)

Expand Down

0 comments on commit 7bb153b

Please sign in to comment.