Find the repository root by searching upward from the current directory. This function starts at the current working directory and walks up the directory tree looking for a `.atomic` directory. This allows commands to work from any subdirectory within a repository. # Returns The path to the repository root (the directory containing `.atomic`). # Errors Returns [`CliError::RepositoryNotFound`]
()
| 246 | /// println!("Repository found at: {}", repo_root.display()); |
| 247 | /// ``` |
| 248 | pub fn find_repository_root() -> CliResult<PathBuf> { |
| 249 | let cwd = std::env::current_dir().map_err(CliError::Io)?; |
| 250 | find_repository_root_from(&cwd) |
| 251 | } |
| 252 | |
| 253 | /// Find the repository root starting from a specific path. |
| 254 | /// |