Skip to content

Commit

Permalink
only check pipeline name without dashes if the name is provided by pr…
Browse files Browse the repository at this point in the history
…ompt
  • Loading branch information
mirpedrol committed Dec 12, 2022
1 parent 2b96d32 commit 6a7da79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions nf_core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def create_param_dict(self, name, description, author, version, template_yaml_pa
and "manifest.name" in config_yml["lint"]["nextflow_config"]
):
return param_dict, skip_paths
# Check that the pipeline name matches the requirements
if not re.match(r"^[a-z]+$", param_dict["short_name"]):
raise UserWarning("[red]Invalid workflow name: must be lowercase without punctuation.")
if param_dict["prefix"] == "nf-core":
# Check that the pipeline name matches the requirements
if not re.match(r"^[a-z]+$", param_dict["short_name"]):
raise UserWarning("[red]Invalid workflow name: must be lowercase without punctuation.")

return param_dict, skip_paths

Expand Down
5 changes: 3 additions & 2 deletions nf_core/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ def make_template_pipeline(self):
plain=True,
).init_pipeline()
except Exception as err:
# If sync fails, remove template_yaml_path before raising error.
os.remove(self.template_yaml_path)
if self.template_yaml_path:
# If sync fails, remove template_yaml_path before raising error.
os.remove(self.template_yaml_path)
# Reset to where you were to prevent git getting messed up.
self.repo.git.reset("--hard")
raise SyncException(f"Failed to rebuild pipeline from template with error:\n{err}")
Expand Down

0 comments on commit 6a7da79

Please sign in to comment.