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

Method vault_materialize

atomic-repository/src/repository/vault.rs:361–379  ·  view source on GitHub ↗

Materialize a single vault entry to disk. Reads the entry from redb and writes it as a markdown file with YAML frontmatter to `.vault/ `. # Errors Returns an error if: - The entry doesn't exist in redb - The file can't be written (permissions, disk full, etc.)

(&self, path: &str)

Source from the content-addressed store, hash-verified

359 /// - The entry doesn't exist in redb
360 /// - The file can't be written (permissions, disk full, etc.)
361 pub fn vault_materialize(&self, path: &str) -> Result<(), RepositoryError> {
362 let entry = self
363 .vault_retrieve(path)?
364 .ok_or_else(|| RepositoryError::FileNotFound {
365 path: PathBuf::from(path),
366 })?;
367
368 let disk_path = self.vault_dir().join(path);
369
370 // Ensure parent directories exist
371 if let Some(parent) = disk_path.parent() {
372 std::fs::create_dir_all(parent)?;
373 }
374
375 let markdown = render_entry_to_markdown(&entry);
376 std::fs::write(&disk_path, markdown)?;
377
378 Ok(())
379 }
380
381 /// Materialize all vault entries to disk.
382 ///

Callers 15

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
vault_goal_startMethod · 0.80
vault_goal_stopMethod · 0.80
vault_goal_resumeMethod · 0.80
vault_intent_createMethod · 0.80
vault_intent_updateMethod · 0.80

Calls 5

render_entry_to_markdownFunction · 0.85
writeFunction · 0.85
vault_retrieveMethod · 0.80
vault_dirMethod · 0.80
parentMethod · 0.80