Skip to content

Commit

Permalink
Add cache command to main
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Feb 20, 2023
1 parent 623ec85 commit 49b3656
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion polaris/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python3

import argparse
import os
import sys

import polaris.run.serial as run_serial
from polaris import list, setup, suite
from polaris import cache, list, setup, suite
from polaris.version import __version__


Expand Down Expand Up @@ -45,6 +46,13 @@ def main():
'suite': suite.main,
'serial': run_serial.main}

# only allow the "polaris cache" command if we're on Anvil or Chrysalis
allow_cache = ('POLARIS_MACHINE' in os.environ and
os.environ['POLARIS_MACHINE'] in ['anvil', 'chrysalis'])

if allow_cache:
commands['cache'] = cache.main

if args.command not in commands:
print(f'Unrecognized command {args.command}')
parser.print_help()
Expand Down

0 comments on commit 49b3656

Please sign in to comment.