Skip to content

Commit

Permalink
Merge pull request #2562 from krokicki/allow_no_yaml
Browse files Browse the repository at this point in the history
Fix bug with creating .nf-core.yml file when it can't be found
  • Loading branch information
mirpedrol authored Dec 14, 2023
2 parents 8035c42 + 9f5a7d8 commit 8bab0f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Replace ModulePatch by ComponentPatch ([#2482](https://github.com/nf-core/tools/pull/2482))
- Fixed `nf-core modules lint` to work with new module structure for nf-test ([#2494](https://github.com/nf-core/tools/pull/2494))
- Add option `--migrate-pytest` to create a module with nf-test taking into account an existing module ([#2549](https://github.com/nf-core/tools/pull/2549))
- When `.nf-core.yml` is not found create it in the current directory instead of the root filesystem ([#2237](https://github.com/nf-core/tools/issues/2237))
- Modules `--migrate-pytest` copies template scripts ([#2568](https://github.com/nf-core/tools/pull/2568))

### Subworkflows
Expand Down
6 changes: 3 additions & 3 deletions nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,12 +1037,12 @@ def load_tools_config(directory: Union[str, Path] = "."):

def determine_base_dir(directory="."):
base_dir = start_dir = Path(directory).absolute()
while not get_first_available_path(base_dir, CONFIG_PATHS) and base_dir != base_dir.parent:
while base_dir != base_dir.parent:
base_dir = base_dir.parent
config_fn = get_first_available_path(base_dir, CONFIG_PATHS)
if config_fn:
break
return directory if base_dir == start_dir else base_dir
return directory if base_dir == start_dir else base_dir
return directory


def get_first_available_path(directory, paths):
Expand Down

0 comments on commit 8bab0f1

Please sign in to comment.