Find config file in current directory or Unity project root. Returns: Path to config file if found, None otherwise.
(cls)
| 91 | |
| 92 | @classmethod |
| 93 | def _find_config_file(cls) -> Path | None: |
| 94 | """Find config file in current directory or Unity project root. |
| 95 | |
| 96 | Returns: |
| 97 | Path to config file if found, None otherwise. |
| 98 | """ |
| 99 | cwd = Path.cwd() |
| 100 | |
| 101 | # Check current directory first |
| 102 | config_in_cwd = cwd / CONFIG_FILE_NAME |
| 103 | if config_in_cwd.exists(): |
| 104 | return config_in_cwd |
| 105 | |
| 106 | # Search for Unity project root |
| 107 | for parent in [cwd, *list(cwd.parents)]: |
| 108 | if (parent / "Assets").is_dir() and (parent / "ProjectSettings").is_dir(): |
| 109 | config_in_project = parent / CONFIG_FILE_NAME |
| 110 | if config_in_project.exists(): |
| 111 | return config_in_project |
| 112 | break |
| 113 | |
| 114 | return None |
| 115 | |
| 116 | def to_toml(self) -> str: |
| 117 | """Generate TOML string from config. |
no outgoing calls
no test coverage detected