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

Method vault_materialize

atomic-repository/src/repository/vault.rs:468–486  ·  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

466 /// - The entry doesn't exist in redb
467 /// - The file can't be written (permissions, disk full, etc.)
468 pub fn vault_materialize(&self, path: &str) -> Result<(), RepositoryError> {
469 let entry = self
470 .vault_retrieve(path)?
471 .ok_or_else(|| RepositoryError::FileNotFound {
472 path: PathBuf::from(path),
473 })?;
474
475 let disk_path = self.vault_dir().join(path);
476
477 // Ensure parent directories exist
478 if let Some(parent) = disk_path.parent() {
479 std::fs::create_dir_all(parent)?;
480 }
481
482 let markdown = render_entry_to_markdown(&entry);
483 std::fs::write(&disk_path, markdown)?;
484
485 Ok(())
486 }
487
488 /// Materialize all vault entries to disk.
489 ///

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