File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -639,13 +639,15 @@ def find_project_root() -> str:
639639 """
640640 current_dir = os .getcwd ()
641641
642- # Look for marker files that indicate the project root
642+ # Look for marker files that indicate the project root.
643+ # Require all markers to avoid incorrectly treating notebook folders
644+ # (which often contain their own README.md) as the repo root.
643645 marker_files = ['requirements.txt' , 'README.md' , 'bicepconfig.json' ]
644646
645647 while current_dir != os .path .dirname (current_dir ): # Stop at filesystem root
646- if any (os .path .exists (os .path .join (current_dir , marker )) for marker in marker_files ):
647- # Return as soon as marker files are found; do not require 'samples' directory
648+ if all (os .path .exists (os .path .join (current_dir , marker )) for marker in marker_files ):
648649 return current_dir
650+
649651 current_dir = os .path .dirname (current_dir )
650652
651653 # If we can't find the project root, raise an error
You can’t perform that action at this time.
0 commit comments