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

Function prune_empty_dirs

src/agents/codex.rs:954–965  ·  view source on GitHub ↗
(root: &Path)

Source from the content-addressed store, hash-verified

952}
953
954fn prune_empty_dirs(root: &Path) -> std::io::Result<()> {
955 for entry in std::fs::read_dir(root)? {
956 let entry = entry?;
957 if entry.file_type()?.is_dir() {
958 prune_empty_dirs(&entry.path())?;
959 }
960 }
961 if std::fs::read_dir(root)?.next().is_none() {
962 std::fs::remove_dir(root)?;
963 }
964 Ok(())
965}
966
967fn remove_codex_plugin_install(install_dir: &Path) -> Result<()> {
968 let Ok(metadata) = std::fs::symlink_metadata(install_dir) else {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected