Skip to content

Commit

Permalink
fix: extra up dir
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefAWasfy committed Oct 11, 2024
1 parent dd4b4e6 commit 64dfb62
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion affinidi-did-resolver-methods/did-peer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ pub fn init() -> Result<Config, DIDPeerError> {
}

fn _get_relative_path(str1: &str, str2: &str) -> String {
let mut repo_name_flag = false;
let repo_name = "affinidi-did-resolver";
// Convert strings into Path objects
let path1 = Path::new(str1);
let path2 = Path::new(str2);
Expand All @@ -145,7 +147,10 @@ fn _get_relative_path(str1: &str, str2: &str) -> String {
if component1 == component2 {
common_part.push(component1);
path2_iter.next();
} else if common_part.capacity() > 0 {
} else if common_part.capacity() > 0 && !repo_name_flag {
if component1.as_os_str().to_str().unwrap() == repo_name {
repo_name_flag = true
}
up += 1;
}
}
Expand Down

0 comments on commit 64dfb62

Please sign in to comment.