fix: correct rename on unix platforms caused by pathdiff#8 (#1587)

* fix: correct rename on unix platforms caused by pathdiff#8

* fix: ensure all calls to pathdiff

* fix: names

* fix: file path on windows
This commit is contained in:
Myriad-Dreamin 2025-03-26 12:46:33 +08:00 committed by GitHub
parent c102ace9ab
commit e4a4fc568f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 44 additions and 28 deletions

View file

@ -21,7 +21,6 @@ dirs.workspace = true
ecow.workspace = true
log.workspace = true
parking_lot.workspace = true
pathdiff.workspace = true
tokio = { workspace = true, features = ["sync"] }
rayon.workspace = true
rpds.workspace = true

View file

@ -405,7 +405,7 @@ impl ResourcePath {
inp.to_path_buf()
} else {
let cwd = std::env::current_dir().unwrap();
pathdiff::diff_paths(inp, &cwd).unwrap()
tinymist_std::path::diff(inp, &cwd).unwrap()
};
let rel = unix_slash(&rel);
ResourcePath("file".into(), rel.to_string())
@ -431,7 +431,7 @@ impl ResourcePath {
if self.0 == "file" {
let path = Path::new(&self.1);
if path.is_absolute() {
Some(pathdiff::diff_paths(path, base).unwrap_or_else(|| path.to_owned()))
Some(tinymist_std::path::diff(path, base).unwrap_or_else(|| path.to_owned()))
} else {
Some(path.to_owned())
}