MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / supervisor_cache_path

Function supervisor_cache_path

crates/openshell-driver-docker/src/lib.rs:3370–3374  ·  view source on GitHub ↗

Cache path for an extracted supervisor binary, keyed by the image's content-addressable digest (e.g. `sha256:abc123…`). The digest-prefixed directory keeps stale extractions from earlier releases isolated so they can be GC'd without affecting the active binary.

(digest: &str)

Source from the content-addressed store, hash-verified

3368/// directory keeps stale extractions from earlier releases isolated so they
3369/// can be GC'd without affecting the active binary.
3370fn supervisor_cache_path(digest: &str) -> CoreResult<PathBuf> {
3371 let base = openshell_core::paths::xdg_data_dir()
3372 .map_err(|err| Error::config(format!("failed to resolve XDG data dir: {err}")))?;
3373 Ok(supervisor_cache_path_with_base(&base, digest))
3374}
3375
3376fn supervisor_cache_path_with_base(base: &Path, digest: &str) -> PathBuf {
3377 let sanitized = digest.replace(':', "-");

Callers 1

Calls 3

xdg_data_dirFunction · 0.85
configFunction · 0.85

Tested by

no test coverage detected