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

Method vault_materialize

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

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

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