Skip to content

Commit

Permalink
get_apps_repo: add YNH_APPS_DIR env var to set --apps-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar committed Aug 11, 2024
1 parent 2db5eaf commit 02fcb1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/appslib/get_apps_repo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import os
import argparse
import tempfile
import logging
Expand All @@ -19,10 +20,13 @@ def __init__(self, *args, **kwargs):


def add_args(parser: argparse.ArgumentParser, required: bool = False) -> None:
env_apps_dir_str = os.environ.get("YNH_APPS_DIR")
env_apps_dir = Path(env_apps_dir_str) if env_apps_dir_str is not None else None

repo_group = parser.add_mutually_exclusive_group(required=required)
repo_group.add_argument("-c", "--apps-repo", type=str, default=DEFAULT_GIT_REPO,
help="Git url to clone the 'apps' repository")
repo_group.add_argument("-d", "--apps-dir", type=Path, help="Path to an existing 'apps' repository")
repo_group.add_argument("-d", "--apps-dir", type=Path, help="Path to an existing 'apps' repository", default=env_apps_dir)


def from_args(args: argparse.Namespace) -> Path:
Expand Down

0 comments on commit 02fcb1d

Please sign in to comment.