Skip to content

Commit

Permalink
handle non-existent modules.json file more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Oct 4, 2024
1 parent 8192ca6 commit 89a41eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nf_core/pipelines/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,12 @@ def copy_components_to_template(self) -> None:
try:
self.repo.git.checkout(self.original_branch, "--", "modules.json")
except GitCommandError as e:
raise SyncExceptionError(f"Could not copy modules.json to TEMPLATE branch:\n{e}")
# don't raise an error if the file doesn't exist
if "did not match any file(s) known to git" in str(e):
log.info("No modules.json file found in current pipeline - not copying")
return
else:
raise SyncExceptionError(f"Could not copy modules.json to TEMPLATE branch:\n{e}")

def commit_template_changes(self):
"""If we have any changes with the new template files, make a git commit"""
Expand Down

0 comments on commit 89a41eb

Please sign in to comment.