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

Function add_vault_files_recursive

atomic-cli/src/commands/vault/init.rs:62–76  ·  view source on GitHub ↗
(repo: &Repository, dir: &std::path::Path)

Source from the content-addressed store, hash-verified

60}
61
62fn add_vault_files_recursive(repo: &Repository, dir: &std::path::Path) -> CliResult<()> {
63 if let Ok(entries) = std::fs::read_dir(dir) {
64 for entry in entries.flatten() {
65 let path = entry.path();
66 if path.is_dir() {
67 add_vault_files_recursive(repo, &path)?;
68 } else if path.is_file() {
69 if let Ok(rel) = path.strip_prefix(repo.root()) {
70 let _ = repo.add(rel, atomic_repository::TrackingOptions::default());
71 }
72 }
73 }
74 }
75 Ok(())
76}

Callers 1

runMethod · 0.70

Calls 5

is_dirMethod · 0.80
pathMethod · 0.45
is_fileMethod · 0.45
rootMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected