(folder, filename)
| 39 | |
| 40 | |
| 41 | def _walk_to_root_until_found(folder, filename) -> str: |
| 42 | checkpath = os.path.join(folder, filename) |
| 43 | if os.path.exists(checkpath) and os.path.isfile(checkpath): |
| 44 | return checkpath |
| 45 | |
| 46 | parent_folder = os.path.dirname(folder) |
| 47 | if parent_folder == folder: # reached the root |
| 48 | return '' |
| 49 | |
| 50 | return _walk_to_root_until_found(parent_folder, filename) |
| 51 | |
| 52 | |
| 53 | def load_dotenv_for_agent( |
no test coverage detected