Skip to content

Commit

Permalink
Revert "fix path 跨系统不一致"
Browse files Browse the repository at this point in the history
This reverts commit 263cd36.
  • Loading branch information
MrBeanCpp committed Dec 24, 2023
1 parent 0e7c964 commit 9de7685
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ pub fn get_relative_path(path: &Path, dir: &Path) -> PathBuf {
rel_path.push("..");
_dir.pop();
}
let rel_path = rel_path.join(abs_path.strip_prefix(common_dir).unwrap());
return unify_path_separator(&rel_path);
rel_path.join(abs_path.strip_prefix(common_dir).unwrap())
}

/// 获取两个路径的公共目录
Expand Down Expand Up @@ -424,7 +423,7 @@ pub fn clean_win_abs_path_pre(path: PathBuf) -> PathBuf {

/// 获取绝对路径(相对于目录current_dir) 不论是否存在
pub fn get_absolute_path(path: &Path) -> PathBuf {
unify_path_separator(get_absolute_path_to_dir(path, &std::env::current_dir().unwrap()).as_path())
get_absolute_path_to_dir(path, &std::env::current_dir().unwrap())
}

/// 获取绝对路径(相对于目录dir) 不论是否存在
Expand Down

0 comments on commit 9de7685

Please sign in to comment.