MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / manifest_path

Function manifest_path

atomic-cli/src/commands/update.rs:170–179  ·  view source on GitHub ↗

Resolve the install manifest path the same way the installer does: `${XDG_STATE_HOME:-${HOME}/.local/state}/atomic/install.json`. We deliberately do NOT use `dirs::state_dir()` — that returns `None` on macOS, but install.sh writes the manifest on macOS too (via the `$HOME` fallback). We must mirror the shell behavior exactly so the router finds what the installer wrote.

(env: &dyn EnvLookup)

Source from the content-addressed store, hash-verified

168/// `$HOME` fallback). We must mirror the shell behavior exactly so the
169/// router finds what the installer wrote.
170fn manifest_path(env: &dyn EnvLookup) -> PathBuf {
171 let state_dir = match env.var("XDG_STATE_HOME") {
172 Some(v) if !v.is_empty() => PathBuf::from(v),
173 _ => {
174 let home = env.var("HOME").unwrap_or_default();
175 PathBuf::from(home).join(".local").join("state")
176 }
177 };
178 state_dir.join("atomic").join("install.json")
179}
180
181/// Determine the install source for a binary at `current_exe`.
182///

Callers 1

detect_sourceFunction · 0.85

Calls 2

varMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected