Finds the workspace root and returns the cache directory path Searches upward from the current directory until it finds a Cargo.toml file, then returns the target/cache directory within that workspace.
()
| 41 | /// Searches upward from the current directory until it finds a Cargo.toml file, |
| 42 | /// then returns the target/cache directory within that workspace. |
| 43 | fn workspace_target_cache() -> Result<PathBuf> { |
| 44 | let workspace_root = find_workspace_root()?; |
| 45 | let cache_dir = workspace_root.join("target").join(CACHE_DIR_NAME); |
| 46 | create_dir_all(&cache_dir)?; |
| 47 | Ok(cache_dir) |
| 48 | } |
| 49 | |
| 50 | /// Finds the workspace root by searching for Cargo.toml upward from the current directory |
| 51 | fn find_workspace_root() -> Result<PathBuf> { |
no test coverage detected