Skip to content

Commit

Permalink
Merge pull request #78 from openworm/develop-branch
Browse files Browse the repository at this point in the history
crawl repos fallback to develop branch
  • Loading branch information
mwatts15 committed Feb 5, 2020
2 parents c2a7608 + 49fb935 commit 84120e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import requests
from tqdm import tqdm
from github import Github
from github.GithubException import UnknownObjectException
import yaml
from jinja2 import Template
from funcy import merge
Expand Down Expand Up @@ -127,7 +128,13 @@ def repo2content(repo):
@return {"filename": (File, "content")}
where `filename` starts with `.openworm.`
"""
tree = repo.get_git_tree("master", recursive=False).tree
try:
tree = repo.get_git_tree("master", recursive=False).tree
except UnknownObjectException as exc:
try:
tree = repo.get_git_tree("develop", recursive=False).tree
except UnknownObjectException:
raise exc
files = [i for i in tree if i.path.lower().startswith(".openworm.")]
if not files:
return {}
Expand Down

0 comments on commit 84120e1

Please sign in to comment.