MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / install_hermes_default

Function install_hermes_default

tests/agent_suite/agent_test.rs:160–180  ·  view source on GitHub ↗
(home: &Path)

Source from the content-addressed store, hash-verified

158 std::sync::OnceLock::new();
159
160fn install_hermes_default(home: &Path) {
161 let files = HERMES_DEFAULT_INSTALL_TEMPLATE.get_or_init(|| {
162 let template_home = TempDir::new().unwrap();
163 HermesIntegration
164 .install(&make_install_ctx(template_home.path()))
165 .unwrap();
166 let root = template_home.path().join(".hermes");
167 let mut files = Vec::new();
168 collect_files_recursive(&root, &root, &mut files);
169 assert!(
170 !files.is_empty(),
171 "hermes install template should contain generated files"
172 );
173 files
174 });
175 for (relative, contents) in files {
176 let path = home.join(".hermes").join(relative);
177 std::fs::create_dir_all(path.parent().unwrap()).unwrap();
178 std::fs::write(path, contents).unwrap();
179 }
180}
181
182fn collect_files_recursive(root: &Path, dir: &Path, out: &mut Vec<(std::path::PathBuf, Vec<u8>)>) {
183 for entry in std::fs::read_dir(dir).unwrap() {

Calls 4

collect_files_recursiveFunction · 0.85
writeFunction · 0.85
make_install_ctxFunction · 0.70
installMethod · 0.45

Tested by

no test coverage detected