Skip to content

Commit

Permalink
fix: make sif cache aware of env
Browse files Browse the repository at this point in the history
  • Loading branch information
rroutsong committed Aug 20, 2024
1 parent 0f78a9e commit b77b72e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chrom-seek
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ def cache(sub_args):
"""
# Check for dependencies
require(['singularity'], ['singularity'])
sif_cache = sub_args.sif_cache

if sub_args.sif_cache is None and 'SINGULARITY_CACHEDIR' in os.environ:
sif_cache = os.environ['SINGULARITY_CACHEDIR']
else:
sif_cache = sub_args.sif_cache
# Get absolute PATH to templates in exome-seek git repo
repo_path = os.path.dirname(os.path.abspath(__file__))
images = os.path.join(repo_path, 'config','containers.json')
Expand Down Expand Up @@ -725,6 +729,7 @@ def parsed_arguments(name, description):
subparser_run.add_argument(
'--singularity-cache',
type = lambda option: check_cache(parser, os.path.abspath(os.path.expanduser(option))),
default = None,
required = False,
help = argparse.SUPPRESS
)
Expand Down Expand Up @@ -941,7 +946,6 @@ def parsed_arguments(name, description):


def main():

# Sanity check for usage
if len(sys.argv) == 1:
# Nothing was provided
Expand Down

0 comments on commit b77b72e

Please sign in to comment.