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

Function workspace_target_cache

crates/csskit_spec_generator/src/fetch_cached.rs:43–48  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

41/// Searches upward from the current directory until it finds a Cargo.toml file,
42/// then returns the target/cache directory within that workspace.
43fn 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
51fn find_workspace_root() -> Result<PathBuf> {

Callers 1

fetch_cachedFunction · 0.85

Calls 1

find_workspace_rootFunction · 0.70

Tested by

no test coverage detected