Skip to content

Commit

Permalink
also check for presence of assembly.py before waiving clone of viral-…
Browse files Browse the repository at this point in the history
…core
  • Loading branch information
tomkinsc committed Mar 28, 2023
1 parent 7179eca commit 140f3d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ def _git_version():
# -- Obtain upstream viral-core module: this is super hacky and not pinned to any version
def _get_viral_core():
viral_core_dir = os.path.abspath('viral-core')
if not os.path.isdir(viral_core_dir):
cmd = ['git', 'clone', '--depth=1', 'https://github.com/broadinstitute/viral-core.git']
subprocess.check_call(cmd)
else: # else fetch latest

# if the viral-core dir and its file exist, pull the latest
if os.path.exists(os.path.join(viral_core_dir,"assembly.py")): # ToDo: check if empty instead
cmd = ['git', '-C', viral_core_dir, 'pull', '--depth=1', 'https://github.com/broadinstitute/viral-core.git']
subprocess.check_call(cmd)
# otherwise clone viral-core, removing the viral-core directory if present
else:
if os.path.isdir(viral_core_dir):
os.remove(viral_core_dir, missing_ok=True)
cmd = ['git', 'clone', '--depth=1', 'https://github.com/broadinstitute/viral-core.git']
subprocess.check_call(cmd)

viral_core_parent_dir = os.path.dirname(os.path.abspath('viral-core'))
if viral_core_parent_dir not in sys.path:
Expand Down

0 comments on commit 140f3d0

Please sign in to comment.