Skip to content

Commit

Permalink
fix: more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kudlatyamroth committed Dec 14, 2023
1 parent c933093 commit e814e08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/schematools/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,18 @@ pub fn discover_git(
format!("refs/remotes/origin/{branch}")
}
};
println!("revparse {:?}", revparse.clone());

let digest = md5::compute(&revparse);
directory.push("schema-tools");
directory.push(format!("{digest:x}"));
println!("directory {:?}", directory);

if directory.exists() && no_cache {
fs::remove_dir_all(directory.as_path()).map_err(Error::DiscoveryCleanRegistryError)?;
} else if directory.exists() {
log::debug!("already exists: {:?}", directory);
println!("already exists {:?}", directory);
return Ok(Registry::new(directory));
} else {
fs::create_dir_all(&directory).map_err(Error::DiscoveryCacheRegistryError)?;
Expand Down Expand Up @@ -227,7 +230,7 @@ mod tests {
let registry = discover_git(
"https://github.com/kstasik/schema-tools.git",
GitCheckoutType::Rev("a279f3b54bc7b03af83162fbf027eb781db1e046".to_string()),
false,
true,
)
.unwrap();
println!("registry {:?}", registry.clone().path);
Expand Down

0 comments on commit e814e08

Please sign in to comment.