From 307d0d4b91729ba9d708f6fbd761414559c45e45 Mon Sep 17 00:00:00 2001
From: mashehu <mashehu3@gmail.com>
Date: Thu, 12 Dec 2024 16:09:53 +0100
Subject: [PATCH] only bump ro-crate if it already exists

---
 nf_core/pipelines/bump_version.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/nf_core/pipelines/bump_version.py b/nf_core/pipelines/bump_version.py
index de0342c7f9..664d7a22a3 100644
--- a/nf_core/pipelines/bump_version.py
+++ b/nf_core/pipelines/bump_version.py
@@ -128,8 +128,9 @@ def bump_pipeline_version(pipeline_obj: Pipeline, new_version: str) -> None:
         yaml_key=["template", "version"],
     )
 
-    # update rocrate
-    ROCrate(pipeline_obj.wf_path).update_rocrate()
+    # update rocrate if ro-crate is present
+    if Path(pipeline_obj.wf_path, "ro-crate-metadata.json").exists():
+        ROCrate(pipeline_obj.wf_path).update_rocrate()
 
 
 def bump_nextflow_version(pipeline_obj: Pipeline, new_version: str) -> None: