Remove dir-s/ectories/ectories-support features (#3647)

This commit is contained in:
Jakub Žádník
2021-06-19 02:29:29 +03:00
committed by GitHub
parent bd44bcee32
commit 4140834e4c
14 changed files with 20 additions and 102 deletions

View File

@ -40,8 +40,8 @@ crossterm = { version = "0.19.0", optional = true }
csv = "1.1.3"
ctrlc = { version = "3.1.7", optional = true }
derive-new = "0.5.8"
directories-next = { version = "2.0.0", optional = true }
dirs-next = { version = "2.0.0", optional = true }
directories-next = "2.0.0"
dirs-next = "2.0.0"
dtparse = "1.2.0"
dunce = "1.0.1"
eml-parser = "0.1.0"
@ -133,7 +133,5 @@ clipboard-cli = ["arboard"]
rustyline-support = ["rustyline"]
stable = []
trash-support = ["trash"]
directories = ["directories-next"]
dirs = ["dirs-next"]
table-pager = ["minus", "crossterm"]
dataframe = ["nu-protocol/dataframe", "polars"]

View File

@ -105,18 +105,7 @@ fn run_with_stdin(
let process_args = command_args
.iter()
.map(|(arg, _is_literal)| {
let home_dir;
#[cfg(feature = "dirs")]
{
home_dir = dirs_next::home_dir;
}
#[cfg(not(feature = "dirs"))]
{
home_dir = || Some(std::path::PathBuf::from("/"));
}
let arg = expand_tilde(arg.deref(), home_dir);
let arg = expand_tilde(arg.deref(), dirs_next::home_dir);
#[cfg(not(windows))]
{

View File

@ -1,6 +1,5 @@
use super::{operate, PathSubcommandArguments};
use crate::prelude::*;
#[cfg(feature = "dirs")]
use nu_engine::filesystem::path::expand_tilde;
use nu_engine::filesystem::path::resolve_dots;
use nu_engine::WholeStreamCommand;
@ -104,7 +103,6 @@ fn action(path: &Path, tag: Tag, args: &PathExpandArguments) -> Value {
))
} else {
// "best effort" mode, just expand tilde and resolve single/double dots
#[cfg(feature = "dirs")]
let path = match expand_tilde(path) {
Some(expanded) => expanded,
None => path.into(),

View File

@ -189,16 +189,6 @@ fn features_enabled() -> Vec<String> {
names.push("ctrlc".to_string());
}
#[cfg(feature = "dirs")]
{
names.push("dirs".to_string());
}
#[cfg(feature = "directories")]
{
names.push("directories".to_string());
}
#[cfg(feature = "ptree")]
{
names.push("ptree".to_string());

View File

@ -127,7 +127,6 @@ fn filesystem_change_current_directory_to_parent_directory_after_delete_cwd() {
})
}
#[cfg(feature = "dirs")]
#[test]
fn filesystem_change_to_home_directory() {
Playground::setup("cd_test_8", |dirs, _| {