mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 02:09:48 +02:00
DriverPwdMap
This commit is contained in:
@@ -21,6 +21,18 @@ fn expand_tilde_with_home(path: impl AsRef<Path>, home: Option<PathBuf>) -> Path
|
||||
let path = path.as_ref();
|
||||
|
||||
if !path.starts_with("~") {
|
||||
use nu_protocol::engine::state_driver_pwd:: {
|
||||
need_expand_current_directory,
|
||||
get_windows_absolute_path,
|
||||
};
|
||||
if need_expand_current_directory(path) {
|
||||
if let Some(current_dir) = get_windows_absolute_path(path) {
|
||||
//println!("Absolute path for {} is: {}", path.display(), current_dir);
|
||||
return PathBuf::from(¤t_dir)
|
||||
} else {
|
||||
println!("Failed to get absolute path for {}", path.display());
|
||||
}
|
||||
}
|
||||
let string = path.to_string_lossy();
|
||||
let mut path_as_string = string.as_ref().bytes();
|
||||
return match path_as_string.next() {
|
||||
|
Reference in New Issue
Block a user