MCPcopy Create free account
hub / github.com/csskit/csskit / find_workspace_root

Function find_workspace_root

crates/csskit_spec_generator/src/main.rs:187–194  ·  view source on GitHub ↗

Finds the workspace root by searching for Cargo.toml upward from the current directory

()

Source from the content-addressed store, hash-verified

185
186/// Finds the workspace root by searching for Cargo.toml upward from the current directory
187fn find_workspace_root() -> Result<PathBuf> {
188 let mut workspace_root = std::env::current_dir()?;
189 while !workspace_root.join("Cargo.toml").exists() {
190 workspace_root =
191 workspace_root.parent().ok_or_else(|| anyhow::anyhow!("Could not find workspace root"))?.to_path_buf();
192 }
193 Ok(workspace_root)
194}
195
196/// Extracts property descriptions from web features data
197///

Callers 2

write_spec_moduleFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected