feat(status): relative path of obj
This commit is contained in:
1 parent
e66dc8d408
commit
8f636b4bf7
6 files changed
+107
-24
No files matched your search
@@ -16,6 +16,15 @@ pub fn to_string(path: &PathBuf) -> String {
|
||||
path.to_str().unwrap().to_string()
|
||||
}
|
||||
|
||||
pub fn get_level(path: &PathBuf) -> i32 {
|
||||
let mut level = 0;
|
||||
let mut path = path.clone();
|
||||
while path.pop() {
|
||||
level += 1;
|
||||
}
|
||||
level
|
||||
}
|
||||
|
||||
/// Improve the path to try remove and solve .. token.
|
||||
/// Taken from https://stackoverflow.com/questions/68231306/stdfscanonicalize-for-files-that-dont-exist
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user