Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with creating .nf-core.yml file when it can't be found #2562

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading