diff --git a/CHANGELOG.md b/CHANGELOG.md index 16262bd1c3..a5795245a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Update output of generation script for API docs to new structure ([#2988](https://github.com/nf-core/tools/pull/2988)) - Add no clobber and put bash options on their own line ([#2991](https://github.com/nf-core/tools/pull/2991)) - update minimal textual version and snapshots ([#2998](https://github.com/nf-core/tools/pull/2998)) +- return directory if base_dir is the root directory ([#3003](https://github.com/nf-core/tools/pull/3003)) ## [v2.14.1 - Tantalum Toad - Patch](https://github.com/nf-core/tools/releases/tag/2.14.1) - [2024-05-09] diff --git a/nf_core/utils.py b/nf_core/utils.py index 8c50f0a49f..1a1e8a2a99 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1069,7 +1069,7 @@ def determine_base_dir(directory="."): 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 or str(base_dir) == base_dir.root) else base_dir def get_first_available_path(directory, paths):