Skip to content

Commit

Permalink
automatically pull asset class and recipe on asset pull, allow opt outs
Browse files Browse the repository at this point in the history
  • Loading branch information
stolarczyk committed Aug 31, 2021
1 parent 2f44d63 commit 5cfb8ce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions refgenie/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,19 @@ def add_subparser(cmd, msg, subparsers):
action="store_true",
help="Remove the genome alias if last asset for that genome is removed.",
)

sps[PULL_CMD].add_argument(
"--skip-asset-class",
action="store_true",
help="Skip pulling asset class definition for the pulled asset.",
)

sps[PULL_CMD].add_argument(
"--skip-recipe",
action="store_true",
help="Skip pulling recipe for the pulled asset.",
)

force_group = sps[PULL_CMD].add_argument_group(
title="Prompt handling",
description="These flags configure the pull prompt responses.",
Expand Down
10 changes: 10 additions & 0 deletions refgenie/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,16 @@ def main():
force_large=force_large,
size_cutoff=args.size_cutoff,
)
if not args.skip_asset_class:
ac_to_pull = rgc.get_assets_asset_class(a["genome"], a["asset"])
_LOGGER.info(
f"The '{a['asset']}' asset is of '{ac_to_pull}'' class. "
f"Pulling the asset class definition from the server."
)
rgc.pull_asset_class(asset_class_name=ac_to_pull, force=force)

if not args.skip_recipe:
rgc.pull_recipe(recipe_name=a["asset"], force=force)

elif args.command in [LIST_LOCAL_CMD, LIST_REMOTE_CMD]:
rgc = RefGenConf(filepath=gencfg, writable=False, skip_read_lock=skip_read_lock)
Expand Down

0 comments on commit 5cfb8ce

Please sign in to comment.