Skip to main content

uv_cache_dir

Function uv_cache_dir 

Source
pub fn uv_cache_dir(
    environment: &[(OsString, OsString)],
    home: Option<&Path>,
) -> Option<PathBuf>
Expand description

What: Resolve uv’s cache directory the way uv does: UV_CACHE_DIR, then XDG_CACHE_HOME/uv, then HOME/.cache/uv; an empty value counts as unset. Option<&Path> is “a borrowed home directory or nothing”; Option<PathBuf> is “an owned path or nothing”. Why: uv runs destructive Git inside throwaway clones it owns there. The home directory is injected so tests never read the real one.

In TS you’d write (pseudocode):

function uvCacheDir(environment: [string, string][], home?: string): string | undefined;