Skip to content

Commit

Permalink
Merge pull request #2123 from mirpedrol/dashed-name
Browse files Browse the repository at this point in the history
only check pipeline name without dashes if the name is provided by prompt
  • Loading branch information
ewels authored Dec 13, 2022
2 parents bc44d2e + 5ccbae8 commit ed9cbb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

### General

- Only check that a pipeline name doesn't contain dashes if the name is provided by prompt of `--name`. Don't check if a template file is used. ([#2123](https://github.com/nf-core/tools/pull/2123))

## [v2.7.1 - Mercury Eagle Patch](https://github.com/nf-core/tools/releases/tag/2.7.1) - [2022-12-08]

- Patch release to fix pipeline sync ([#2110](https://github.com/nf-core/tools/pull/2110))
Expand Down
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 ed9cbb4

Please sign in to comment.