Replace dirs and directories with maintained (#2949)

This commit is contained in:
Caden Haustein 2021-01-19 20:24:27 +00:00 committed by GitHub
parent 2e6d836dd1
commit 430da53f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 389 additions and 302 deletions

612
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -42,8 +42,8 @@ codespan-reporting = "0.11.0"
csv = "1.1.3"
ctrlc = { version = "3.1.6", optional = true }
derive-new = "0.5.8"
directories = { version = "3.0.1", optional = true }
dirs = { version = "3.0.1", optional = true }
directories-next = { version = "2.0.0", optional = true }
dirs-next = { version = "2.0.0", optional = true }
dtparse = "1.2.0"
dunce = "1.0.1"
eml-parser = "0.1.0"
@ -134,3 +134,5 @@ rich-benchmark = ["heim"]
rustyline-support = ["rustyline", "nu-engine/rustyline-support"]
stable = []
trash-support = ["trash"]
dirs = ["dirs-next"]
directories = ["directories-next"]

View File

@ -29,7 +29,7 @@ impl PathCompleter {
{
let home_prefix = format!("~{}", SEP);
if base_dir_name.starts_with(&home_prefix) {
let mut home_dir = dirs::home_dir().unwrap_or_else(|| PathBuf::from("~"));
let mut home_dir = dirs_next::home_dir().unwrap_or_else(|| PathBuf::from("~"));
home_dir.push(&base_dir_name[2..]);
home_dir
} else {

View File

@ -41,8 +41,8 @@ codespan-reporting = "0.11.0"
csv = "1.1.3"
ctrlc = { version = "3.1.6", optional = true }
derive-new = "0.5.8"
directories = { version = "3.0.1", optional = true }
dirs = { version = "3.0.1", optional = true }
directories-next = { version = "2.0.0", optional = true }
dirs-next = { version = "2.0.0", optional = true }
dtparse = "1.2.0"
dunce = "1.0.1"
eml-parser = "0.1.0"
@ -131,3 +131,5 @@ rich-benchmark = ["heim"]
rustyline-support = ["rustyline"]
stable = []
trash-support = ["trash"]
directories = ["directories-next"]
dirs = ["dirs-next"]

View File

@ -96,7 +96,7 @@ async fn run_with_stdin(
#[cfg(feature = "dirs")]
{
home_dir = dirs::home_dir;
home_dir = dirs_next::home_dir;
}
#[cfg(not(feature = "dirs"))]
{

View File

@ -139,7 +139,7 @@ fn filesystem_change_to_home_directory() {
"#
);
assert_eq!(Some(PathBuf::from(actual.out)), dirs::home_dir());
assert_eq!(Some(PathBuf::from(actual.out)), dirs_next::home_dir());
})
}

View File

@ -16,25 +16,29 @@ byte-unit = "4.0.9"
chrono = "0.4.15"
derive-new = "0.5.8"
directories = {version = "3.0.1", optional = true}
dirs = {version = "3.0.1", optional = true}
directories-next = { version = "2.0.0", optional = true }
dirs-next = { version = "2.0.0", optional = true }
getset = "0.1.1"
indexmap = {version = "1.6.0", features = ["serde-1"]}
indexmap = { version = "1.6.0", features = ["serde-1"] }
log = "0.4.11"
num-bigint = {version = "0.3.0", features = ["serde"]}
num-bigint = { version = "0.3.0", features = ["serde"] }
num-format = "0.4.0"
num-traits = "0.2.12"
parking_lot = "0.11.0"
query_interface = "0.3.5"
serde = {version = "1.0.115", features = ["derive"]}
serde = { version = "1.0.115", features = ["derive"] }
toml = "0.5.6"
nu-errors = {version = "0.25.2", path = "../nu-errors"}
nu-protocol = {version = "0.25.2", path = "../nu-protocol"}
nu-source = {version = "0.25.2", path = "../nu-source"}
nu-table = {version = "0.25.2", path = "../nu-table"}
nu-test-support = {version = "0.25.2", path = "../nu-test-support"}
nu-value-ext = {version = "0.25.2", path = "../nu-value-ext"}
nu-errors = { version = "0.25.2", path = "../nu-errors" }
nu-protocol = { version = "0.25.2", path = "../nu-protocol" }
nu-source = { version = "0.25.2", path = "../nu-source" }
nu-table = { version = "0.25.2", path = "../nu-table" }
nu-test-support = { version = "0.25.2", path = "../nu-test-support" }
nu-value-ext = { version = "0.25.2", path = "../nu-value-ext" }
[target.'cfg(unix)'.dependencies]
users = "0.10.0"
[features]
directories = ["directories-next"]
dirs = ["dirs-next"]

View File

@ -145,7 +145,7 @@ pub fn value_to_toml_value(v: &Value) -> Result<toml::Value, ShellError> {
#[cfg(feature = "directories")]
pub fn config_path() -> Result<PathBuf, ShellError> {
use directories::ProjectDirs;
use directories_next::ProjectDirs;
let dir = ProjectDirs::from("org", "nushell", "nu")
.ok_or_else(|| ShellError::untagged_runtime_error("Couldn't find project directory"))?;
@ -181,7 +181,7 @@ pub fn default_path_for(file: &Option<PathBuf>) -> Result<PathBuf, ShellError> {
#[cfg(feature = "directories")]
pub fn user_data() -> Result<PathBuf, ShellError> {
use directories::ProjectDirs;
use directories_next::ProjectDirs;
let dir = ProjectDirs::from("org", "nushell", "nu")
.ok_or_else(|| ShellError::untagged_runtime_error("Couldn't find project directory"))?;

View File

@ -7,36 +7,36 @@ name = "nu-engine"
version = "0.25.2"
[dependencies]
nu-data = {version = "0.25.2", path = "../nu-data"}
nu-errors = {version = "0.25.2", path = "../nu-errors"}
nu-parser = {version = "0.25.2", path = "../nu-parser"}
nu-plugin = {version = "0.25.2", path = "../nu-plugin"}
nu-protocol = {version = "0.25.2", path = "../nu-protocol"}
nu-source = {version = "0.25.2", path = "../nu-source"}
nu-stream = {version = "0.25.2", path = "../nu-stream"}
nu-value-ext = {version = "0.25.2", path = "../nu-value-ext"}
nu-data = { version = "0.25.2", path = "../nu-data" }
nu-errors = { version = "0.25.2", path = "../nu-errors" }
nu-parser = { version = "0.25.2", path = "../nu-parser" }
nu-plugin = { version = "0.25.2", path = "../nu-plugin" }
nu-protocol = { version = "0.25.2", path = "../nu-protocol" }
nu-source = { version = "0.25.2", path = "../nu-source" }
nu-stream = { version = "0.25.2", path = "../nu-stream" }
nu-value-ext = { version = "0.25.2", path = "../nu-value-ext" }
ansi_term = "0.12.1"
async-recursion = "0.3.1"
async-trait = "0.1.40"
bytes = "0.5.6"
derive-new = "0.5.8"
dirs = {version = "3.0.1", optional = true}
dirs-next = { version = "2.0.0", optional = true }
dunce = "1.0.1"
encoding_rs = "0.8.24"
filesize = "0.2.0"
fs_extra = "1.2.0"
futures = {version = "0.3.5", features = ["compat", "io-compat"]}
futures = { version = "0.3.5", features = ["compat", "io-compat"] }
futures-util = "0.3.8"
futures_codec = "0.4.1"
getset = "0.1.1"
glob = "0.3.0"
indexmap = {version = "1.6.0", features = ["serde-1"]}
indexmap = { version = "1.6.0", features = ["serde-1"] }
itertools = "0.10.0"
log = "0.4.11"
parking_lot = "0.11.0"
rayon = "1.4.0"
serde = {version = "1.0.115", features = ["derive"]}
serde = { version = "1.0.115", features = ["derive"] }
serde_json = "1.0.57"
tempfile = "3.1.0"
term_size = "0.3.2"
@ -47,7 +47,8 @@ umask = "1.0.0"
users = "0.10.0"
[dev-dependencies]
nu-test-support = {version = "0.25.2", path = "../nu-test-support"}
nu-test-support = { version = "0.25.2", path = "../nu-test-support" }
[features]
rustyline-support = []
dirs = ["dirs-next"]

View File

@ -72,7 +72,7 @@ impl FilesystemShell {
pub fn homedir_if_possible() -> Option<PathBuf> {
#[cfg(feature = "dirs")]
{
dirs::home_dir()
dirs_next::home_dir()
}
#[cfg(not(feature = "dirs"))]

View File

@ -144,7 +144,7 @@ impl Shell for HelpShell {
fn homedir(&self) -> Option<PathBuf> {
#[cfg(feature = "dirs")]
{
dirs::home_dir()
dirs_next::home_dir()
}
#[cfg(not(feature = "dirs"))]