mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Remove dir-s/ectories/ectories-support features (#3647)
This commit is contained in:
@ -17,8 +17,5 @@ nu-protocol = { version = "0.32.1", path = "../nu-protocol" }
|
||||
nu-source = { version = "0.32.1", path = "../nu-source" }
|
||||
nu-test-support = { version = "0.32.1", path = "../nu-test-support" }
|
||||
|
||||
dirs-next = { version = "2.0.0", optional = true }
|
||||
dirs-next = "2.0.0"
|
||||
indexmap = { version = "1.6.1", features = ["serde-1"] }
|
||||
|
||||
[features]
|
||||
dirs = ["dirs-next"]
|
||||
|
@ -26,19 +26,12 @@ impl PathCompleter {
|
||||
let base_dir = if base_dir_name.is_empty() {
|
||||
PathBuf::from(".")
|
||||
} else {
|
||||
#[cfg(feature = "dirs")]
|
||||
{
|
||||
let home_prefix = format!("~{}", SEP);
|
||||
if base_dir_name.starts_with(&home_prefix) {
|
||||
let mut home_dir = dirs_next::home_dir().unwrap_or_else(|| PathBuf::from("~"));
|
||||
home_dir.push(&base_dir_name[2..]);
|
||||
home_dir
|
||||
} else {
|
||||
PathBuf::from(base_dir_name)
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "dirs"))]
|
||||
{
|
||||
let home_prefix = format!("~{}", SEP);
|
||||
if base_dir_name.starts_with(&home_prefix) {
|
||||
let mut home_dir = dirs_next::home_dir().unwrap_or_else(|| PathBuf::from("~"));
|
||||
home_dir.push(&base_dir_name[2..]);
|
||||
home_dir
|
||||
} else {
|
||||
PathBuf::from(base_dir_name)
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user