-
Notifications
You must be signed in to change notification settings - Fork 186
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files☔ View full report in Codecov by Sentry. |
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! :)
close #3002