Skip to content

Commit

Permalink
more debugging info
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Aug 6, 2024
1 parent e3ee4cb commit 75a8683
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions fs-index/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,41 @@ impl<Id: ResourceId> ResourceIndex<Id> {
pub fn build<P: AsRef<Path>>(root_path: P) -> Result<Self> {
log::debug!("Building index at root path: {:?}", root_path.as_ref());

// Print all files in the root path
for entry in fs::read_dir(root_path.as_ref())? {
let entry = entry?;
let path = entry.path();
printl!("Found file: {:?}", path);
}

let root_path = root_path.as_ref();
// Canonicalize the root path
let root_path = root_path.canonicalize()?;

// Print all files in the root path
for entry in fs::read_dir(&root_path)? {
let entry = entry?;
let path = entry.path();
printl!("Found file: {:?}", path);
}

let mut id_to_paths: HashMap<Id, HashSet<PathBuf>> = HashMap::new();
let mut path_to_resource = HashMap::new();

// Discover paths in the root directory
let paths = discover_paths(&root_path)?;
// Print discovered paths
for path in &paths {
printl!("Discovered path: {:?}", path);
}
let entries: HashMap<PathBuf, Timestamped<Id>> =
scan_entries(&root_path, paths);

// Print entries
for (path, id) in &entries {
printl!("Found entry: {:?} -> {:?}", path, id);
}

// Strip the root path from the entries
let entries: HashMap<PathBuf, Timestamped<Id>> = entries
.into_iter()
Expand Down

0 comments on commit 75a8683

Please sign in to comment.