mirror of
https://github.com/nushell/nushell.git
synced 2024-12-03 22:06:54 +01:00
Remove path_abs, use omnipath is better, :)
This commit is contained in:
parent
c3b84abbf4
commit
a7c9695944
@ -16,7 +16,6 @@ dirs = { workspace = true }
|
|||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
omnipath = { workspace = true }
|
omnipath = { workspace = true }
|
||||||
path_abs = "0.5.1"
|
|
||||||
|
|
||||||
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "android")))'.dependencies]
|
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "android")))'.dependencies]
|
||||||
pwd = { workspace = true }
|
pwd = { workspace = true }
|
||||||
|
@ -171,16 +171,13 @@ pub mod _impl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_full_path_name_w(path_str: &str) -> Option<String> {
|
fn get_full_path_name_w(path_str: &str) -> Option<String> {
|
||||||
use path_abs::PathAbs;
|
use omnipath::sys_absolute;
|
||||||
if let Ok(path_abs) = PathAbs::new(path_str) {
|
if let Ok(path_sys_abs) = sys_absolute(PathBuf::from(path_str).as_path()) {
|
||||||
let full_path = path_abs.as_path().to_str()?;
|
Some(path_sys_abs.to_str()?.to_string())
|
||||||
// Remove the preceding \\?\ characters
|
} else {
|
||||||
if full_path.starts_with(r"\\?\") {
|
|
||||||
return Some(full_path[4..].to_string());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
use std::sync::{Mutex, OnceLock};
|
use std::sync::{Mutex, OnceLock};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user