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

return directory if base_dir is the root directory #3003

Merged
merged 2 commits into from
May 28, 2024

Conversation

mirpedrol
Copy link
Member

close #3002

@mirpedrol mirpedrol mentioned this pull request May 27, 2024
2 tasks
Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.08%. Comparing base (b06712a) to head (ae47db3).

Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about convertinh it to a Path to skip the or clause.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The or is checking that we are not returning the root (/). This function will look for a directory which contains a config file but if non exist then it returns root, but we don't want to create a config file there. So, if no config was found, we return directory which should be the pipeline or modules directory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, then all is good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! :)

@mirpedrol mirpedrol merged commit 2f0f4a0 into nf-core:dev May 28, 2024
36 checks passed
@mirpedrol mirpedrol deleted the fix-recreating-config branch May 28, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants