Given a globset builder and a path, build globs for both the file and directory patterns This is needed because by default glob does not match children of a dir so we need both patterns to exist in a globset.
(builder: &mut GlobSetBuilder, path: &str)
| 193 | /// This is needed because by default glob does not match children of a dir so we need both |
| 194 | /// patterns to exist in a globset. |
| 195 | pub fn add_gitignore_globs(builder: &mut GlobSetBuilder, path: &str) -> Result<()> { |
| 196 | let glob_for_file = Glob::new(path)?; |
| 197 | let dir_pattern: String = format!("{}/**", path.trim_end_matches('/')); |
| 198 | let glob_for_dir = Glob::new(&dir_pattern)?; |
| 199 | builder.add(glob_for_file); |
| 200 | builder.add(glob_for_dir); |
| 201 | Ok(()) |
| 202 | } |
| 203 | |
| 204 | /// Generate a unique identifier for an agent based on its path and name |
| 205 | /// Path resolver with hierarchy-aware methods |