mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-25 13:23:44 +00:00
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:
parent
c102ace9ab
commit
e4a4fc568f
19 changed files with 44 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue