Expand description
dir-aspect: Detect what kind of application folder a directory is.
Checks for marker directories (.git/, .obsidian/, etc.) to determine
which “aspects” a directory has. Useful for enabling feature-specific
behavior based on the kind of project a directory represents.
§Example
use dir_aspect::{Aspect, detect_aspects};
let aspects = detect_aspects(std::path::Path::new("/path/to/dir"));
if aspects.contains(&Aspect::Git) {
println!("This is a git repository");
}Enums§
- Aspect
- Detected aspects of a directory.
Functions§
- detect_
aspects - Detect aspects of a directory by checking for marker directories.
- detect_
obsidian_ vault_ id - Look up the Obsidian vault ID for a directory by reading Obsidian’s
obsidian.json.