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

Method open

atomic-cli/src/commands/intent/key_cache.rs:91–97  ·  view source on GitHub ↗

Open the cache, degrading to an empty cache on any problem. Missing file, unreadable file, or an unparseable/corrupt file all yield an empty cache — a broken cache must never block verification.

()

Source from the content-addressed store, hash-verified

89 /// Missing file, unreadable file, or an unparseable/corrupt file all
90 /// yield an empty cache — a broken cache must never block verification.
91 pub fn open() -> Self {
92 let dir = global_config_dir().unwrap_or_else(|| {
93 let home = dirs::home_dir().unwrap_or(PathBuf::from("."));
94 home.join(".atomic")
95 });
96 Self::open_at(dir.as_path())
97 }
98
99 /// Open the cache rooted at `dir` (used by tests).
100 pub fn open_at(dir: &Path) -> Self {

Calls 1

global_config_dirFunction · 0.85