forked from extern/nushell
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
5f11be69ed | |||
69765340f3 | |||
4be392fcb4 | |||
81531e224e | |||
370639d7d7 | |||
d326f6def6 |
43
Cargo.lock
generated
43
Cargo.lock
generated
@ -2465,7 +2465,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"assert_cmd",
|
||||
"chrono",
|
||||
@ -2516,7 +2516,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-cli"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crossterm",
|
||||
@ -2543,7 +2543,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-color-config"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"nu-ansi-term",
|
||||
"nu-json",
|
||||
@ -2554,7 +2554,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-command"
|
||||
version = "0.66.1"
|
||||
version = "0.66.3"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"alphanumeric-sort",
|
||||
@ -2645,7 +2645,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-engine"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"nu-glob",
|
||||
@ -2657,7 +2657,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-glob"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"doc-comment",
|
||||
"tempdir",
|
||||
@ -2665,7 +2665,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-json"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"linked-hash-map",
|
||||
@ -2678,7 +2678,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-parser"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"itertools",
|
||||
@ -2693,7 +2693,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-path"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"dirs-next",
|
||||
"dunce",
|
||||
@ -2702,7 +2702,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-plugin"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"capnp",
|
||||
@ -2714,7 +2714,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"heapless",
|
||||
"nu-ansi-term",
|
||||
@ -2723,7 +2723,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-protocol"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"byte-unit",
|
||||
"chrono",
|
||||
@ -2731,6 +2731,7 @@ dependencies = [
|
||||
"indexmap",
|
||||
"miette 5.1.1",
|
||||
"nu-json",
|
||||
"nu-path",
|
||||
"nu-utils",
|
||||
"num-format",
|
||||
"regex",
|
||||
@ -2743,7 +2744,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-system"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"errno",
|
||||
@ -2757,7 +2758,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-table"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"nu-ansi-term",
|
||||
@ -2768,7 +2769,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-term-grid"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"strip-ansi-escapes",
|
||||
"unicode-width",
|
||||
@ -2776,7 +2777,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-test-support"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"getset",
|
||||
"hamcrest2",
|
||||
@ -2788,7 +2789,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-utils"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"crossterm_winapi",
|
||||
"lscolors",
|
||||
@ -2806,7 +2807,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_example"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"nu-plugin",
|
||||
"nu-protocol",
|
||||
@ -2814,7 +2815,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"git2",
|
||||
"nu-engine",
|
||||
@ -2824,7 +2825,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"nu-plugin",
|
||||
"nu-protocol",
|
||||
@ -2833,7 +2834,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu_plugin_query"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"gjson",
|
||||
"nu-engine",
|
||||
|
32
Cargo.toml
32
Cargo.toml
@ -11,7 +11,7 @@ name = "nu"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/nushell/nushell"
|
||||
rust-version = "1.60"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -39,20 +39,20 @@ ctrlc = "3.2.1"
|
||||
log = "0.4"
|
||||
miette = "5.1.0"
|
||||
nu-ansi-term = "0.46.0"
|
||||
nu-cli = { path="./crates/nu-cli", version = "0.66.1" }
|
||||
nu-color-config = { path = "./crates/nu-color-config", version = "0.66.1" }
|
||||
nu-command = { path="./crates/nu-command", version = "0.66.1" }
|
||||
nu-engine = { path="./crates/nu-engine", version = "0.66.1" }
|
||||
nu-json = { path="./crates/nu-json", version = "0.66.1" }
|
||||
nu-parser = { path="./crates/nu-parser", version = "0.66.1" }
|
||||
nu-path = { path="./crates/nu-path", version = "0.66.1" }
|
||||
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.66.1" }
|
||||
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.66.1" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.66.1" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.66.1" }
|
||||
nu-table = { path = "./crates/nu-table", version = "0.66.1" }
|
||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.66.1" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.66.1" }
|
||||
nu-cli = { path="./crates/nu-cli", version = "0.66.2" }
|
||||
nu-color-config = { path = "./crates/nu-color-config", version = "0.66.2" }
|
||||
nu-command = { path="./crates/nu-command", version = "0.66.3" }
|
||||
nu-engine = { path="./crates/nu-engine", version = "0.66.2" }
|
||||
nu-json = { path="./crates/nu-json", version = "0.66.2" }
|
||||
nu-parser = { path="./crates/nu-parser", version = "0.66.2" }
|
||||
nu-path = { path="./crates/nu-path", version = "0.66.2" }
|
||||
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.66.2" }
|
||||
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.66.2" }
|
||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.66.2" }
|
||||
nu-system = { path = "./crates/nu-system", version = "0.66.2" }
|
||||
nu-table = { path = "./crates/nu-table", version = "0.66.2" }
|
||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.66.2" }
|
||||
nu-utils = { path = "./crates/nu-utils", version = "0.66.2" }
|
||||
reedline = { version = "0.9.0", features = ["bashisms", "sqlite"]}
|
||||
pretty_env_logger = "0.4.0"
|
||||
rayon = "1.5.1"
|
||||
@ -64,7 +64,7 @@ openssl = { version = "0.10.38", features = ["vendored"], optional = true }
|
||||
signal-hook = { version = "0.3.14", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path="./crates/nu-test-support", version = "0.66.1" }
|
||||
nu-test-support = { path="./crates/nu-test-support", version = "0.66.2" }
|
||||
tempfile = "3.2.0"
|
||||
assert_cmd = "2.0.2"
|
||||
pretty_assertions = "1.0.0"
|
||||
|
@ -4,21 +4,21 @@ description = "CLI-related functionality for Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-cli"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dev-dependencies]
|
||||
nu-test-support = { path="../nu-test-support", version = "0.66.1" }
|
||||
nu-command = { path = "../nu-command", version = "0.66.1" }
|
||||
nu-test-support = { path="../nu-test-support", version = "0.66.2" }
|
||||
nu-command = { path = "../nu-command", version = "0.66.2" }
|
||||
rstest = "0.15.0"
|
||||
|
||||
[dependencies]
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.66.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.2" }
|
||||
nu-ansi-term = "0.46.0"
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.66.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.66.2" }
|
||||
reedline = { version = "0.9.0", features = ["bashisms", "sqlite"]}
|
||||
crossterm = "0.23.0"
|
||||
miette = { version = "5.1.0", features = ["fancy"] }
|
||||
|
@ -4,11 +4,11 @@ description = "Color configuration code used by Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-color-config"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
nu-ansi-term = "0.46.0"
|
||||
nu-json = { path = "../nu-json", version = "0.66.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.66.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.66.2" }
|
||||
nu-table = { path = "../nu-table", version = "0.66.2" }
|
||||
serde = { version="1.0.123", features=["derive"] }
|
||||
|
@ -4,25 +4,25 @@ description = "Nushell's built-in commands"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-command"
|
||||
version = "0.66.1"
|
||||
version = "0.66.3"
|
||||
build = "build.rs"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.66.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.66.1" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.66.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.1" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-system = { path = "../nu-system", version = "0.66.1" }
|
||||
nu-table = { path = "../nu-table", version = "0.66.1" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.66.1" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.66.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.1" }
|
||||
nu-color-config = { path = "../nu-color-config", version = "0.66.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.2" }
|
||||
nu-json = { path = "../nu-json", version = "0.66.2" }
|
||||
nu-parser = { path = "../nu-parser", version = "0.66.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.2" }
|
||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.66.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
nu-system = { path = "../nu-system", version = "0.66.2" }
|
||||
nu-table = { path = "../nu-table", version = "0.66.2" }
|
||||
nu-term-grid = { path = "../nu-term-grid", version = "0.66.2" }
|
||||
nu-test-support = { path = "../nu-test-support", version = "0.66.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.2" }
|
||||
nu-ansi-term = "0.46.0"
|
||||
|
||||
# Potential dependencies for extras
|
||||
|
@ -1,16 +1,11 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fs::read_link;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use itertools::Itertools;
|
||||
use nu_engine::env::current_dir;
|
||||
use nu_engine::CallExt;
|
||||
use nu_glob::GlobResult;
|
||||
use nu_path::dots::expand_ndots;
|
||||
use nu_path::{canonicalize_with, expand_path_with};
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::span::span as merge_spans;
|
||||
use nu_protocol::{
|
||||
Category, Example, IntoInterruptiblePipelineData, PipelineData, ShellError, Signature, Span,
|
||||
Spanned, SyntaxShape, Value,
|
||||
@ -46,12 +41,7 @@ impl Command for Cp {
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("cp")
|
||||
.rest(
|
||||
"source(s)",
|
||||
SyntaxShape::String,
|
||||
"the place(s) to copy from",
|
||||
)
|
||||
// .required("source", SyntaxShape::GlobPattern, "the place to copy from")
|
||||
.required("source", SyntaxShape::GlobPattern, "the place to copy from")
|
||||
.required("destination", SyntaxShape::Filepath, "the place to copy to")
|
||||
.switch(
|
||||
"recursive",
|
||||
@ -81,16 +71,15 @@ impl Command for Cp {
|
||||
call: &Call,
|
||||
_input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let mut src_vec: Vec<Spanned<String>> = call.rest(engine_state, stack, 0)?;
|
||||
// read dst as final argument
|
||||
let dst: Spanned<String> = src_vec.pop().expect("Final argument is destination");
|
||||
|
||||
let src: Spanned<String> = call.req(engine_state, stack, 0)?;
|
||||
let dst: Spanned<String> = call.req(engine_state, stack, 1)?;
|
||||
let recursive = call.has_flag("recursive");
|
||||
let verbose = call.has_flag("verbose");
|
||||
let interactive = call.has_flag("interactive");
|
||||
|
||||
let current_dir_path = current_dir(engine_state, stack)?;
|
||||
let destination = expand_ndots(current_dir_path.join(dst.item.as_str()));
|
||||
let source = current_dir_path.join(src.item.as_str());
|
||||
let destination = current_dir_path.join(dst.item.as_str());
|
||||
|
||||
let path_last_char = destination.as_os_str().to_string_lossy().chars().last();
|
||||
let is_directory = path_last_char == Some('/') || path_last_char == Some('\\');
|
||||
@ -103,54 +92,24 @@ impl Command for Cp {
|
||||
let ctrlc = engine_state.ctrlc.clone();
|
||||
let span = call.head;
|
||||
|
||||
let mut sources: Vec<PathBuf> = vec![];
|
||||
let mut path_to_span: HashMap<PathBuf, Span> = HashMap::new();
|
||||
|
||||
for src in &src_vec {
|
||||
let source = current_dir_path.join(src.item.as_str());
|
||||
let glob_results: Vec<GlobResult> =
|
||||
match nu_glob::glob_with(&source.to_string_lossy(), GLOB_PARAMS) {
|
||||
Ok(files) => files.collect(),
|
||||
Err(e) => {
|
||||
return Err(ShellError::GenericError(
|
||||
e.to_string(),
|
||||
"invalid pattern".to_string(),
|
||||
Some(src.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
let mut new_sources: Vec<PathBuf> = vec![];
|
||||
for glob_result in glob_results {
|
||||
match glob_result {
|
||||
Ok(path) => {
|
||||
path_to_span.insert(path.clone(), src.span);
|
||||
new_sources.push(path);
|
||||
}
|
||||
Err(e) => {
|
||||
return Err(ShellError::GenericError(
|
||||
e.to_string(),
|
||||
"glob iteration error".to_string(),
|
||||
Some(src.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
}
|
||||
let sources: Vec<_> = match nu_glob::glob_with(&source.to_string_lossy(), GLOB_PARAMS) {
|
||||
Ok(files) => files.collect(),
|
||||
Err(e) => {
|
||||
return Err(ShellError::GenericError(
|
||||
e.to_string(),
|
||||
"invalid pattern".to_string(),
|
||||
Some(src.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
|
||||
sources.append(&mut new_sources);
|
||||
}
|
||||
};
|
||||
|
||||
if sources.is_empty() {
|
||||
return Err(ShellError::GenericError(
|
||||
"No matches found".into(),
|
||||
"no matches found".into(),
|
||||
Some(merge_spans(
|
||||
&src_vec.into_iter().map(|src| src.span).collect_vec(),
|
||||
)),
|
||||
Some(src.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
@ -166,25 +125,21 @@ impl Command for Cp {
|
||||
));
|
||||
}
|
||||
|
||||
let any_source_is_dir = sources.iter().find(|f| f.is_dir());
|
||||
let any_source_is_dir = sources.iter().any(|f| matches!(f, Ok(f) if f.is_dir()));
|
||||
|
||||
if let Some(dir_source) = any_source_is_dir {
|
||||
if !recursive {
|
||||
return Err(ShellError::GenericError(
|
||||
"Directories must be copied using \"--recursive\"".into(),
|
||||
"resolves to a directory (not copied)".into(),
|
||||
Some(*path_to_span.get(dir_source).unwrap_or_else(|| {
|
||||
panic!("Key {:?} should exist", dir_source.as_os_str())
|
||||
})),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
if any_source_is_dir && !recursive {
|
||||
return Err(ShellError::GenericError(
|
||||
"Directories must be copied using \"--recursive\"".into(),
|
||||
"resolves to a directory (not copied)".into(),
|
||||
Some(src.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
|
||||
let mut result = Vec::new();
|
||||
|
||||
for entry in sources.into_iter() {
|
||||
for entry in sources.into_iter().flatten() {
|
||||
let mut sources = FileStructure::new();
|
||||
sources.walk_decorate(&entry, engine_state, stack)?;
|
||||
|
||||
@ -208,8 +163,7 @@ impl Command for Cp {
|
||||
let res = if src == dst {
|
||||
let message = format!(
|
||||
"src {:?} and dst {:?} are identical(not copied)",
|
||||
src.as_os_str(),
|
||||
destination
|
||||
source, destination
|
||||
);
|
||||
|
||||
return Err(ShellError::GenericError(
|
||||
|
@ -1,17 +1,15 @@
|
||||
use crate::DirBuilder;
|
||||
use crate::DirInfo;
|
||||
use chrono::{DateTime, Local, LocalResult, TimeZone, Utc};
|
||||
use itertools::Itertools;
|
||||
use nu_engine::env::current_dir;
|
||||
use nu_engine::CallExt;
|
||||
use nu_glob::MatchOptions;
|
||||
use nu_path::expand_to_real_path;
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::IntoPipelineData;
|
||||
use nu_protocol::{
|
||||
Category, DataSource, Example, IntoInterruptiblePipelineData, PipelineData, PipelineMetadata,
|
||||
ShellError, Signature, Span, Spanned, SyntaxShape, Value,
|
||||
Category, DataSource, Example, IntoInterruptiblePipelineData, IntoPipelineData, PipelineData,
|
||||
PipelineMetadata, ShellError, Signature, Span, Spanned, SyntaxShape, Value,
|
||||
};
|
||||
use pathdiff::diff_paths;
|
||||
|
||||
@ -40,11 +38,7 @@ impl Command for Ls {
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("ls")
|
||||
// Using a string instead of a glob pattern shape so it won't auto-expand
|
||||
.rest(
|
||||
"pattern(s)",
|
||||
SyntaxShape::String,
|
||||
"the glob pattern(s) to use",
|
||||
)
|
||||
.optional("pattern", SyntaxShape::String, "the glob pattern to use")
|
||||
.switch("all", "Show hidden files", Some('a'))
|
||||
.switch(
|
||||
"long",
|
||||
@ -87,23 +81,19 @@ impl Command for Ls {
|
||||
let call_span = call.head;
|
||||
let cwd = current_dir(engine_state, stack)?;
|
||||
|
||||
let mut shell_errors: Vec<ShellError> = vec![];
|
||||
let pattern_args: Vec<Spanned<String>> = call.rest(engine_state, stack, 0)?;
|
||||
let glob_results = if !pattern_args.is_empty() {
|
||||
pattern_args
|
||||
.into_iter()
|
||||
.flat_map(|pattern_arg| {
|
||||
let mut path = expand_to_real_path(pattern_arg.clone().item);
|
||||
let p_tag = pattern_arg.span;
|
||||
let cwd = cwd.clone();
|
||||
let ctrl_c = ctrl_c.clone();
|
||||
let pattern_arg: Option<Spanned<String>> = call.opt(engine_state, stack, 0)?;
|
||||
|
||||
let expanded = nu_path::expand_path_with(&path, &cwd);
|
||||
// Avoid checking and pushing "*" to the path when directory (do not show contents) flag is true
|
||||
if !directory && expanded.is_dir() {
|
||||
if permission_denied(&path) {
|
||||
#[cfg(unix)]
|
||||
let error_msg = format!(
|
||||
let (path, p_tag, absolute_path) = match pattern_arg {
|
||||
Some(p) => {
|
||||
let p_tag = p.span;
|
||||
let mut p = expand_to_real_path(p.item);
|
||||
|
||||
let expanded = nu_path::expand_path_with(&p, &cwd);
|
||||
// Avoid checking and pushing "*" to the path when directory (do not show contents) flag is true
|
||||
if !directory && expanded.is_dir() {
|
||||
if permission_denied(&p) {
|
||||
#[cfg(unix)]
|
||||
let error_msg = format!(
|
||||
"The permissions of {:o} do not allow access for this user",
|
||||
expanded
|
||||
.metadata()
|
||||
@ -114,221 +104,94 @@ impl Command for Ls {
|
||||
.mode()
|
||||
& 0o0777
|
||||
);
|
||||
#[cfg(not(unix))]
|
||||
let error_msg = String::from("Permission denied");
|
||||
shell_errors.push(ShellError::GenericError(
|
||||
"Permission denied".to_string(),
|
||||
error_msg,
|
||||
Some(p_tag),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
if is_empty_dir(&expanded) {
|
||||
return Vec::from([Value::nothing(call_span)]).into_iter();
|
||||
}
|
||||
path.push("*");
|
||||
}
|
||||
|
||||
let absolute_path = path.is_absolute();
|
||||
|
||||
let hidden_dir_specified = is_hidden_dir(&path);
|
||||
|
||||
let glob_path = Spanned {
|
||||
item: path.display().to_string(),
|
||||
span: p_tag,
|
||||
};
|
||||
|
||||
let glob_options = if all {
|
||||
None
|
||||
} else {
|
||||
let mut glob_options = MatchOptions::new();
|
||||
glob_options.recursive_match_hidden_dir = false;
|
||||
Some(glob_options)
|
||||
};
|
||||
let (prefix, paths) =
|
||||
nu_engine::glob_from(&glob_path, &cwd, call_span, glob_options)
|
||||
.expect("glob failure");
|
||||
|
||||
let mut paths_peek = paths.peekable();
|
||||
if paths_peek.peek().is_none() {
|
||||
shell_errors.push(ShellError::GenericError(
|
||||
format!("No matches found for {}", &path.display().to_string()),
|
||||
"".to_string(),
|
||||
#[cfg(not(unix))]
|
||||
let error_msg = String::from("Permission denied");
|
||||
return Err(ShellError::GenericError(
|
||||
"Permission denied".to_string(),
|
||||
error_msg,
|
||||
Some(p_tag),
|
||||
None,
|
||||
Some("no matches found".to_string()),
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
|
||||
let mut hidden_dirs = vec![];
|
||||
|
||||
paths_peek
|
||||
.into_iter()
|
||||
.filter_map(move |x| match x {
|
||||
Ok(path) => {
|
||||
let metadata = match std::fs::symlink_metadata(&path) {
|
||||
Ok(metadata) => Some(metadata),
|
||||
Err(_) => None,
|
||||
};
|
||||
if path_contains_hidden_folder(&path, &hidden_dirs) {
|
||||
return None;
|
||||
}
|
||||
|
||||
if !all && !hidden_dir_specified && is_hidden_dir(&path) {
|
||||
if path.is_dir() {
|
||||
hidden_dirs.push(path);
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
let display_name = if short_names {
|
||||
path.file_name().map(|os| os.to_string_lossy().to_string())
|
||||
} else if full_paths || absolute_path {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
} else if let Some(prefix) = &prefix {
|
||||
if let Ok(remainder) = path.strip_prefix(&prefix) {
|
||||
if directory {
|
||||
// When the path is the same as the cwd, path_diff should be "."
|
||||
let path_diff = if let Some(path_diff_not_dot) =
|
||||
diff_paths(&path, &cwd)
|
||||
{
|
||||
let path_diff_not_dot =
|
||||
path_diff_not_dot.to_string_lossy();
|
||||
if path_diff_not_dot.is_empty() {
|
||||
".".to_string()
|
||||
} else {
|
||||
path_diff_not_dot.to_string()
|
||||
}
|
||||
} else {
|
||||
path.to_string_lossy().to_string()
|
||||
};
|
||||
|
||||
Some(path_diff)
|
||||
} else {
|
||||
let new_prefix =
|
||||
if let Some(pfx) = diff_paths(&prefix, &cwd) {
|
||||
pfx
|
||||
} else {
|
||||
prefix.to_path_buf()
|
||||
};
|
||||
|
||||
Some(
|
||||
new_prefix
|
||||
.join(remainder)
|
||||
.to_string_lossy()
|
||||
.to_string(),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
}
|
||||
} else {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
}
|
||||
.ok_or_else(|| {
|
||||
ShellError::GenericError(
|
||||
format!("Invalid file name: {:}", path.to_string_lossy()),
|
||||
"invalid file name".into(),
|
||||
Some(call_span),
|
||||
None,
|
||||
Vec::new(),
|
||||
)
|
||||
});
|
||||
|
||||
match display_name {
|
||||
Ok(name) => {
|
||||
let entry = dir_entry_dict(
|
||||
&path,
|
||||
&name,
|
||||
metadata.as_ref(),
|
||||
call_span,
|
||||
long,
|
||||
du,
|
||||
ctrl_c.clone(),
|
||||
);
|
||||
match entry {
|
||||
Ok(value) => Some(value),
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
}
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
}
|
||||
_ => Some(Value::Nothing { span: call_span }),
|
||||
})
|
||||
.collect_vec()
|
||||
.into_iter()
|
||||
})
|
||||
.collect_vec()
|
||||
} else {
|
||||
let (path, p_tag, absolute_path) = if directory {
|
||||
(PathBuf::from("."), call_span, false)
|
||||
} else if is_empty_dir(current_dir(engine_state, stack)?) {
|
||||
return Ok(Value::nothing(call_span).into_pipeline_data());
|
||||
} else {
|
||||
(PathBuf::from("./*"), call_span, false)
|
||||
};
|
||||
|
||||
let hidden_dir_specified = is_hidden_dir(&path);
|
||||
|
||||
let glob_path = Spanned {
|
||||
item: path.display().to_string(),
|
||||
span: p_tag,
|
||||
};
|
||||
|
||||
let glob_options = if all {
|
||||
None
|
||||
} else {
|
||||
let mut glob_options = MatchOptions::new();
|
||||
glob_options.recursive_match_hidden_dir = false;
|
||||
Some(glob_options)
|
||||
};
|
||||
let (prefix, paths) = nu_engine::glob_from(&glob_path, &cwd, call_span, glob_options)?;
|
||||
|
||||
let mut paths_peek = paths.peekable();
|
||||
if paths_peek.peek().is_none() {
|
||||
return Err(ShellError::GenericError(
|
||||
format!("No matches found for {}", &path.display().to_string()),
|
||||
"".to_string(),
|
||||
None,
|
||||
Some("no matches found".to_string()),
|
||||
Vec::new(),
|
||||
));
|
||||
if is_empty_dir(&expanded) {
|
||||
return Ok(Value::nothing(call_span).into_pipeline_data());
|
||||
}
|
||||
p.push("*");
|
||||
}
|
||||
let absolute_path = p.is_absolute();
|
||||
(p, p_tag, absolute_path)
|
||||
}
|
||||
None => {
|
||||
// Avoid pushing "*" to the default path when directory (do not show contents) flag is true
|
||||
if directory {
|
||||
(PathBuf::from("."), call_span, false)
|
||||
} else if is_empty_dir(current_dir(engine_state, stack)?) {
|
||||
return Ok(Value::nothing(call_span).into_pipeline_data());
|
||||
} else {
|
||||
(PathBuf::from("./*"), call_span, false)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let mut hidden_dirs = vec![];
|
||||
let hidden_dir_specified = is_hidden_dir(&path);
|
||||
|
||||
paths_peek
|
||||
.into_iter()
|
||||
.filter_map(move |x| match x {
|
||||
Ok(path) => {
|
||||
let metadata = match std::fs::symlink_metadata(&path) {
|
||||
Ok(metadata) => Some(metadata),
|
||||
Err(_) => None,
|
||||
};
|
||||
if path_contains_hidden_folder(&path, &hidden_dirs) {
|
||||
return None;
|
||||
let glob_path = Spanned {
|
||||
item: path.display().to_string(),
|
||||
span: p_tag,
|
||||
};
|
||||
|
||||
let glob_options = if all {
|
||||
None
|
||||
} else {
|
||||
let mut glob_options = MatchOptions::new();
|
||||
glob_options.recursive_match_hidden_dir = false;
|
||||
Some(glob_options)
|
||||
};
|
||||
let (prefix, paths) = nu_engine::glob_from(&glob_path, &cwd, call_span, glob_options)?;
|
||||
|
||||
let mut paths_peek = paths.peekable();
|
||||
if paths_peek.peek().is_none() {
|
||||
return Err(ShellError::GenericError(
|
||||
format!("No matches found for {}", &path.display().to_string()),
|
||||
"".to_string(),
|
||||
None,
|
||||
Some("no matches found".to_string()),
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
|
||||
let mut hidden_dirs = vec![];
|
||||
|
||||
Ok(paths_peek
|
||||
.into_iter()
|
||||
.filter_map(move |x| match x {
|
||||
Ok(path) => {
|
||||
let metadata = match std::fs::symlink_metadata(&path) {
|
||||
Ok(metadata) => Some(metadata),
|
||||
Err(_) => None,
|
||||
};
|
||||
if path_contains_hidden_folder(&path, &hidden_dirs) {
|
||||
return None;
|
||||
}
|
||||
|
||||
if !all && !hidden_dir_specified && is_hidden_dir(&path) {
|
||||
if path.is_dir() {
|
||||
hidden_dirs.push(path);
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
if !all && !hidden_dir_specified && is_hidden_dir(&path) {
|
||||
if path.is_dir() {
|
||||
hidden_dirs.push(path);
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
let display_name = if short_names {
|
||||
path.file_name().map(|os| os.to_string_lossy().to_string())
|
||||
} else if full_paths || absolute_path {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
} else if let Some(prefix) = &prefix {
|
||||
if let Ok(remainder) = path.strip_prefix(&prefix) {
|
||||
if directory {
|
||||
// When the path is the same as the cwd, path_diff should be "."
|
||||
let path_diff = if let Some(path_diff_not_dot) =
|
||||
diff_paths(&path, &cwd)
|
||||
{
|
||||
let display_name = if short_names {
|
||||
path.file_name().map(|os| os.to_string_lossy().to_string())
|
||||
} else if full_paths || absolute_path {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
} else if let Some(prefix) = &prefix {
|
||||
if let Ok(remainder) = path.strip_prefix(&prefix) {
|
||||
if directory {
|
||||
// When the path is the same as the cwd, path_diff should be "."
|
||||
let path_diff =
|
||||
if let Some(path_diff_not_dot) = diff_paths(&path, &cwd) {
|
||||
let path_diff_not_dot = path_diff_not_dot.to_string_lossy();
|
||||
if path_diff_not_dot.is_empty() {
|
||||
".".to_string()
|
||||
@ -339,63 +202,53 @@ impl Command for Ls {
|
||||
path.to_string_lossy().to_string()
|
||||
};
|
||||
|
||||
Some(path_diff)
|
||||
} else {
|
||||
let new_prefix = if let Some(pfx) = diff_paths(&prefix, &cwd) {
|
||||
pfx
|
||||
} else {
|
||||
prefix.to_path_buf()
|
||||
};
|
||||
|
||||
Some(new_prefix.join(remainder).to_string_lossy().to_string())
|
||||
}
|
||||
Some(path_diff)
|
||||
} else {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
let new_prefix = if let Some(pfx) = diff_paths(&prefix, &cwd) {
|
||||
pfx
|
||||
} else {
|
||||
prefix.to_path_buf()
|
||||
};
|
||||
|
||||
Some(new_prefix.join(remainder).to_string_lossy().to_string())
|
||||
}
|
||||
} else {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
}
|
||||
.ok_or_else(|| {
|
||||
ShellError::GenericError(
|
||||
format!("Invalid file name: {:}", path.to_string_lossy()),
|
||||
"invalid file name".into(),
|
||||
Some(call_span),
|
||||
None,
|
||||
Vec::new(),
|
||||
)
|
||||
});
|
||||
|
||||
match display_name {
|
||||
Ok(name) => {
|
||||
let entry = dir_entry_dict(
|
||||
&path,
|
||||
&name,
|
||||
metadata.as_ref(),
|
||||
call_span,
|
||||
long,
|
||||
du,
|
||||
ctrl_c.clone(),
|
||||
);
|
||||
match entry {
|
||||
Ok(value) => Some(value),
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
}
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
} else {
|
||||
Some(path.to_string_lossy().to_string())
|
||||
}
|
||||
_ => Some(Value::Nothing { span: call_span }),
|
||||
})
|
||||
.collect_vec()
|
||||
};
|
||||
.ok_or_else(|| {
|
||||
ShellError::GenericError(
|
||||
format!("Invalid file name: {:}", path.to_string_lossy()),
|
||||
"invalid file name".into(),
|
||||
Some(call_span),
|
||||
None,
|
||||
Vec::new(),
|
||||
)
|
||||
});
|
||||
|
||||
if !shell_errors.is_empty() {
|
||||
return Err(shell_errors.pop().expect("Vec pop error"));
|
||||
}
|
||||
|
||||
Ok(glob_results
|
||||
.into_iter()
|
||||
.filter(|result| !matches!(result, Value::Nothing { .. }))
|
||||
match display_name {
|
||||
Ok(name) => {
|
||||
let entry = dir_entry_dict(
|
||||
&path,
|
||||
&name,
|
||||
metadata.as_ref(),
|
||||
call_span,
|
||||
long,
|
||||
du,
|
||||
ctrl_c.clone(),
|
||||
);
|
||||
match entry {
|
||||
Ok(value) => Some(value),
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
}
|
||||
Err(err) => Some(Value::Error { error: err }),
|
||||
}
|
||||
}
|
||||
_ => Some(Value::Nothing { span: call_span }),
|
||||
})
|
||||
.into_pipeline_data_with_metadata(
|
||||
PipelineMetadata {
|
||||
data_source: DataSource::Ls,
|
||||
@ -426,11 +279,6 @@ impl Command for Ls {
|
||||
example: "ls *.rs",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "List all rust files and all toml files",
|
||||
example: "ls *.rs *.toml",
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "List all files and directories whose name do not contain 'bar'",
|
||||
example: "ls -s | where name !~ bar",
|
||||
|
@ -1,11 +1,8 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use super::util::try_interaction;
|
||||
use itertools::Itertools;
|
||||
use nu_engine::env::current_dir;
|
||||
use nu_engine::CallExt;
|
||||
use nu_glob::GlobResult;
|
||||
use nu_path::dots::expand_ndots;
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::{
|
||||
@ -39,16 +36,11 @@ impl Command for Mv {
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("mv")
|
||||
.rest(
|
||||
"source(s)",
|
||||
SyntaxShape::String,
|
||||
"the location(s) to move files/directories from",
|
||||
.required(
|
||||
"source",
|
||||
SyntaxShape::GlobPattern,
|
||||
"the location to move files/directories from",
|
||||
)
|
||||
// .required(
|
||||
// "source",
|
||||
// SyntaxShape::GlobPattern,
|
||||
// "the location to move files/directories from",
|
||||
// )
|
||||
.required(
|
||||
"destination",
|
||||
SyntaxShape::Filepath,
|
||||
@ -72,132 +64,114 @@ impl Command for Mv {
|
||||
_input: PipelineData,
|
||||
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
|
||||
// TODO: handle invalid directory or insufficient permissions when moving
|
||||
let mut spanned_sources: Vec<Spanned<String>> = call.rest(engine_state, stack, 0)?;
|
||||
// read destination as final argument
|
||||
let spanned_destination: Spanned<String> =
|
||||
call.req(engine_state, stack, spanned_sources.len() - 1)?;
|
||||
// don't read destination argument
|
||||
spanned_sources.pop();
|
||||
let spanned_source: Spanned<String> = call.req(engine_state, stack, 0)?;
|
||||
let spanned_destination: Spanned<String> = call.req(engine_state, stack, 1)?;
|
||||
let verbose = call.has_flag("verbose");
|
||||
let interactive = call.has_flag("interactive");
|
||||
// let force = call.has_flag("force");
|
||||
|
||||
let ctrlc = engine_state.ctrlc.clone();
|
||||
|
||||
let path = current_dir(engine_state, stack).expect("Failed current_dir");
|
||||
let path = current_dir(engine_state, stack)?;
|
||||
let source = path.join(spanned_source.item.as_str());
|
||||
let destination = path.join(spanned_destination.item.as_str());
|
||||
|
||||
let mut sources = nu_glob::glob_with(&source.to_string_lossy(), GLOB_PARAMS)
|
||||
.map_or_else(|_| Vec::new(), Iterator::collect);
|
||||
|
||||
if sources.is_empty() {
|
||||
return Err(ShellError::GenericError(
|
||||
"Invalid file or pattern".into(),
|
||||
"invalid file or pattern".into(),
|
||||
Some(spanned_source.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
|
||||
// We have two possibilities.
|
||||
//
|
||||
// First, the destination exists.
|
||||
// - If a directory, move everything into that directory, otherwise
|
||||
// - if only a single source, overwrite the file, otherwise
|
||||
// - error.
|
||||
//
|
||||
// Second, the destination doesn't exist, so we can only rename a single source. Otherwise
|
||||
// it's an error.
|
||||
|
||||
if (destination.exists() && !destination.is_dir() && sources.len() > 1)
|
||||
|| (!destination.exists() && sources.len() > 1)
|
||||
{
|
||||
return Err(ShellError::GenericError(
|
||||
"Can only move multiple sources if destination is a directory".into(),
|
||||
"destination must be a directory when multiple sources".into(),
|
||||
Some(spanned_destination.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
|
||||
let some_if_source_is_destination = sources
|
||||
.iter()
|
||||
.find(|f| matches!(f, Ok(f) if destination.starts_with(f)));
|
||||
if destination.exists() && destination.is_dir() && sources.len() == 1 {
|
||||
if let Some(Ok(filename)) = some_if_source_is_destination {
|
||||
return Err(ShellError::GenericError(
|
||||
format!(
|
||||
"Not possible to move {:?} to itself",
|
||||
filename.file_name().expect("Invalid file name")
|
||||
),
|
||||
"cannot move to itself".into(),
|
||||
Some(spanned_destination.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(Ok(_filename)) = some_if_source_is_destination {
|
||||
sources = sources
|
||||
.into_iter()
|
||||
.filter(|f| matches!(f, Ok(f) if !destination.starts_with(f)))
|
||||
.collect();
|
||||
}
|
||||
|
||||
let span = call.head;
|
||||
|
||||
Ok(spanned_sources
|
||||
Ok(sources
|
||||
.into_iter()
|
||||
.flat_map(move |spanned_source| {
|
||||
let path = path.clone();
|
||||
let source = path.join(spanned_source.item.as_str());
|
||||
let destination = expand_ndots(path.join(spanned_destination.item.as_str()));
|
||||
|
||||
let mut sources: Vec<GlobResult> =
|
||||
nu_glob::glob_with(&source.to_string_lossy(), GLOB_PARAMS)
|
||||
.map_or_else(|_| Vec::new(), Iterator::collect);
|
||||
|
||||
if sources.is_empty() {
|
||||
let err = ShellError::GenericError(
|
||||
"Invalid file or pattern".into(),
|
||||
"invalid file or pattern".into(),
|
||||
Some(spanned_source.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
);
|
||||
return Vec::from([Value::Error { error: err }]).into_iter();
|
||||
.flatten()
|
||||
.filter_map(move |entry| {
|
||||
let result = move_file(
|
||||
Spanned {
|
||||
item: entry.clone(),
|
||||
span: spanned_source.span,
|
||||
},
|
||||
Spanned {
|
||||
item: destination.clone(),
|
||||
span: spanned_destination.span,
|
||||
},
|
||||
interactive,
|
||||
);
|
||||
if let Err(error) = result {
|
||||
Some(Value::Error { error })
|
||||
} else if verbose {
|
||||
let val = if result.expect("Error value when unwrapping mv result") {
|
||||
format!(
|
||||
"moved {:} to {:}",
|
||||
entry.to_string_lossy(),
|
||||
destination.to_string_lossy()
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"{:} not moved to {:}",
|
||||
entry.to_string_lossy(),
|
||||
destination.to_string_lossy()
|
||||
)
|
||||
};
|
||||
Some(Value::String { val, span })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
// We have two possibilities.
|
||||
//
|
||||
// First, the destination exists.
|
||||
// - If a directory, move everything into that directory, otherwise
|
||||
// - if only a single source, overwrite the file, otherwise
|
||||
// - error.
|
||||
//
|
||||
// Second, the destination doesn't exist, so we can only rename a single source. Otherwise
|
||||
// it's an error.
|
||||
|
||||
if (destination.exists() && !destination.is_dir() && sources.len() > 1)
|
||||
|| (!destination.exists() && sources.len() > 1)
|
||||
{
|
||||
let err = ShellError::GenericError(
|
||||
"Can only move multiple sources if destination is a directory".into(),
|
||||
"destination must be a directory when multiple sources".into(),
|
||||
Some(spanned_destination.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
);
|
||||
return Vec::from([Value::Error { error: err }]).into_iter();
|
||||
}
|
||||
|
||||
let some_if_source_is_destination = sources
|
||||
.iter()
|
||||
.find(|f| matches!(f, Ok(f) if destination.starts_with(f)));
|
||||
if destination.exists() && destination.is_dir() && sources.len() == 1 {
|
||||
if let Some(Ok(filename)) = some_if_source_is_destination {
|
||||
let err = ShellError::GenericError(
|
||||
format!(
|
||||
"Not possible to move {:?} to itself",
|
||||
filename.file_name().expect("Invalid file name")
|
||||
),
|
||||
"cannot move to itself".into(),
|
||||
Some(spanned_destination.span),
|
||||
None,
|
||||
Vec::new(),
|
||||
);
|
||||
return Vec::from([Value::Error { error: err }]).into_iter();
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(Ok(_filename)) = some_if_source_is_destination {
|
||||
sources = sources
|
||||
.into_iter()
|
||||
.filter(|f| matches!(f, Ok(f) if !destination.starts_with(f)))
|
||||
.collect();
|
||||
}
|
||||
|
||||
sources
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.filter_map(move |entry| {
|
||||
let entry = expand_ndots(entry);
|
||||
let result = move_file(
|
||||
Spanned {
|
||||
item: entry.clone(),
|
||||
span: spanned_source.span,
|
||||
},
|
||||
Spanned {
|
||||
item: destination.clone(),
|
||||
span: spanned_destination.span,
|
||||
},
|
||||
interactive,
|
||||
);
|
||||
if let Err(error) = result {
|
||||
Some(Value::Error { error })
|
||||
} else if verbose {
|
||||
let val = if result.expect("Error value when unwrapping mv result") {
|
||||
format!(
|
||||
"moved {:} to {:}",
|
||||
entry.to_string_lossy(),
|
||||
destination.to_string_lossy()
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"{:} not moved to {:}",
|
||||
entry.to_string_lossy(),
|
||||
destination.to_string_lossy()
|
||||
)
|
||||
};
|
||||
Some(Value::String { val, span })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect_vec()
|
||||
.into_iter()
|
||||
})
|
||||
.into_pipeline_data(ctrlc))
|
||||
}
|
||||
|
@ -17,22 +17,6 @@ fn copies_a_file() {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copies_multiple_files() {
|
||||
Playground::setup("cp_test_1_1", |dirs, sandbox| {
|
||||
sandbox
|
||||
.with_files(vec![EmptyFile("a.txt"), EmptyFile("b.txt")])
|
||||
.mkdir("dest");
|
||||
nu!(
|
||||
cwd: dirs.test(),
|
||||
"cp a.txt b.txt dest",
|
||||
);
|
||||
|
||||
assert!(dirs.test().join("dest/a.txt").exists());
|
||||
assert!(dirs.test().join("dest/b.txt").exists());
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copies_the_file_inside_directory_if_path_to_copy_is_directory() {
|
||||
Playground::setup("cp_test_2", |dirs, _| {
|
||||
|
@ -335,28 +335,6 @@ fn lists_files_including_starting_with_dot() {
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lists_regular_files_using_multiple_asterisk_wildcards() {
|
||||
Playground::setup("ls_test_10", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![
|
||||
EmptyFile("los.txt"),
|
||||
EmptyFile("tres.txt"),
|
||||
EmptyFile("amigos.txt"),
|
||||
EmptyFile("arepas.clu"),
|
||||
]);
|
||||
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
ls *.txt *.clu
|
||||
| length
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "4");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_all_columns() {
|
||||
Playground::setup("ls_test_all_columns", |dirs, sandbox| {
|
||||
@ -527,3 +505,11 @@ fn can_list_system_folder() {
|
||||
));
|
||||
assert_eq!(ls_with_filter.err, "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_a_directory_not_exists() {
|
||||
Playground::setup("ls_test_directory_not_exists", |dirs, _sandbox| {
|
||||
let actual = nu!(cwd: dirs.test(), "ls a_directory_not_exists");
|
||||
assert!(actual.err.contains("directory not found"));
|
||||
})
|
||||
}
|
||||
|
@ -22,36 +22,6 @@ fn moves_a_file() {
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn moves_multiple_files() {
|
||||
Playground::setup("mv_test_1_1", |dirs, sandbox| {
|
||||
sandbox
|
||||
.mkdir("expected")
|
||||
.with_files(vec![EmptyFile("andres.txt"), EmptyFile("yehuda.txt")])
|
||||
.within("foo")
|
||||
.with_files(vec![EmptyFile("bar.txt")]);
|
||||
|
||||
let original_1 = dirs.test().join("andres.txt");
|
||||
let original_2 = dirs.test().join("yehuda.txt");
|
||||
let original_3 = dirs.test().join("foo/bar.txt");
|
||||
let expected_1 = dirs.test().join("expected/andres.txt");
|
||||
let expected_2 = dirs.test().join("expected/yehuda.txt");
|
||||
let expected_3 = dirs.test().join("expected/bar.txt");
|
||||
|
||||
nu!(
|
||||
cwd: dirs.test(),
|
||||
"mv andres.txt yehuda.txt foo/bar.txt expected"
|
||||
);
|
||||
|
||||
assert!(!original_1.exists());
|
||||
assert!(!original_2.exists());
|
||||
assert!(!original_3.exists());
|
||||
assert!(expected_1.exists());
|
||||
assert!(expected_2.exists());
|
||||
assert!(expected_3.exists());
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overwrites_if_moving_to_existing_file() {
|
||||
Playground::setup("mv_test_2", |dirs, sandbox| {
|
||||
|
@ -4,13 +4,13 @@ description = "Nushell's evaluation engine"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-engine"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.66.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.66.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.2" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.2" }
|
||||
|
||||
chrono = { version="0.4.19", features=["serde"] }
|
||||
sysinfo = "0.24.6"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nu-glob"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
authors = ["The Nushell Project Developers", "The Rust Project Developers"]
|
||||
license = "MIT/Apache-2.0"
|
||||
description = """
|
||||
|
@ -4,7 +4,7 @@ description = "Fork of serde-hjson"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-json"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -20,5 +20,5 @@ lazy_static = "1"
|
||||
linked-hash-map = { version="0.5", optional=true }
|
||||
|
||||
[dev-dependencies]
|
||||
nu-path = { path="../nu-path", version = "0.66.1" }
|
||||
nu-path = { path="../nu-path", version = "0.66.2" }
|
||||
serde_json = "1.0"
|
||||
|
@ -4,7 +4,7 @@ description = "Nushell's parser"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-parser"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4.19"
|
||||
@ -12,9 +12,9 @@ itertools = "0.10"
|
||||
miette = "5.1.0"
|
||||
thiserror = "1.0.31"
|
||||
serde_json = "1.0"
|
||||
nu-path = {path = "../nu-path", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-plugin = { path = "../nu-plugin", optional = true, version = "0.66.1" }
|
||||
nu-path = {path = "../nu-path", version = "0.66.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
nu-plugin = { path = "../nu-plugin", optional = true, version = "0.66.2" }
|
||||
log = "0.4"
|
||||
|
||||
[features]
|
||||
|
@ -4,7 +4,7 @@ description = "Path handling library for Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-path"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
dirs-next = "2.0.0"
|
||||
|
@ -4,12 +4,12 @@ description = "Functionality for building Nushell plugins"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-plugin"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
bincode = "1.3.3"
|
||||
capnp = "0.14.3"
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
nu-engine = { path = "../nu-engine", version = "0.66.2" }
|
||||
serde = {version = "1.0.130", features = ["derive"]}
|
||||
serde_json = { version = "1.0"}
|
||||
|
@ -4,7 +4,7 @@ description = "Pretty hex dump of bytes slice in the common style."
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-pretty-hex"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
@ -4,12 +4,13 @@ description = "Nushell's internal protocols, including its abstract syntax tree"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-protocol"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.1" }
|
||||
nu-utils = { path = "../nu-utils", version = "0.66.2" }
|
||||
nu-path = { path = "../nu-path", version = "0.66.2" }
|
||||
thiserror = "1.0.31"
|
||||
miette = { version = "5.1.0", features = ["fancy"] }
|
||||
serde = {version = "1.0.130", features = ["derive"]}
|
||||
@ -18,7 +19,7 @@ indexmap = { version="1.7", features=["serde-1"] }
|
||||
chrono-humanize = "0.2.1"
|
||||
byte-unit = "4.0.9"
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
nu-json = { path = "../nu-json", version = "0.66.1" }
|
||||
nu-json = { path = "../nu-json", version = "0.66.2" }
|
||||
typetag = "0.1.8"
|
||||
num-format = "0.4.0"
|
||||
sys-locale = "0.2.0"
|
||||
|
2
crates/nu-system/Cargo.lock
generated
2
crates/nu-system/Cargo.lock
generated
@ -148,7 +148,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nu-system"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
dependencies = [
|
||||
"errno",
|
||||
"libproc",
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["The Nushell Project Developers", "procs creators"]
|
||||
description = "Nushell system querying"
|
||||
name = "nu-system"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
|
@ -4,7 +4,7 @@ description = "Nushell table printing"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-table"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[[bin]]
|
||||
@ -13,7 +13,7 @@ path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
nu-ansi-term = "0.46.0"
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2" }
|
||||
strip-ansi-escapes = "0.1.1"
|
||||
atty = "0.2.14"
|
||||
tabled = { version = "0.8.0", features = ["color"] }
|
||||
|
@ -4,7 +4,7 @@ description = "Nushell grid printing"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-term-grid"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[[bin]]
|
||||
|
@ -4,14 +4,14 @@ description = "Support for writing Nushell tests"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu-test-support"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-path = { path="../nu-path", version = "0.66.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.1" }
|
||||
nu-path = { path="../nu-path", version = "0.66.2" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.66.2" }
|
||||
|
||||
getset = "0.1.1"
|
||||
num-bigint = { version="0.4.3", features=["serde"] }
|
||||
|
@ -4,7 +4,7 @@ description = "Nushell utility functions"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu-utils"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[[bin]]
|
||||
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.1", features = ["plugin"] }
|
||||
nu-plugin = { path = "../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path = "../nu-protocol", version = "0.66.2", features = ["plugin"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
typetag = "0.1.8"
|
||||
|
@ -4,8 +4,8 @@ description = "A version incrementer plugin for Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_example"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1", features = ["plugin"]}
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2", features = ["plugin"]}
|
||||
|
@ -4,14 +4,14 @@ description = "A git status plugin for Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_gstat"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-engine = { path="../nu-engine", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-engine = { path="../nu-engine", version = "0.66.2" }
|
||||
|
||||
git2 = "0.14.2"
|
||||
|
@ -4,13 +4,13 @@ description = "A version incrementer plugin for Nushell"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_inc"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1", features = ["plugin"]}
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2", features = ["plugin"]}
|
||||
|
||||
semver = "0.11.0"
|
||||
|
@ -4,15 +4,15 @@ description = "A Nushell plugin to query JSON, XML, and various web data"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_query"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-engine = { path="../nu-engine", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-engine = { path="../nu-engine", version = "0.66.2" }
|
||||
gjson = "0.8.0"
|
||||
scraper = "0.13.0"
|
||||
sxd-document = "0.3.2"
|
||||
|
@ -4,18 +4,18 @@ description = "A plugin to display charts"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_chart"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-data = { path="../nu-data", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-value-ext = { path="../nu-value-ext", version = "0.66.1" }
|
||||
nu-data = { path="../nu-data", version = "0.66.2" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
nu-value-ext = { path="../nu-value-ext", version = "0.66.2" }
|
||||
|
||||
crossterm = "0.19.0"
|
||||
tui = { version="0.15.0", default-features=false, features=["crossterm"] }
|
||||
|
@ -4,7 +4,7 @@ description = "A converter plugin to the bson format for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_from_bson"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
@ -12,9 +12,9 @@ doctest = false
|
||||
[dependencies]
|
||||
bigdecimal = { package = "bigdecimal", version = "0.3.0", features = ["serde"] }
|
||||
bson = { version = "2.0.1", features = [ "chrono-0_4" ] }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -4,16 +4,16 @@ description = "A converter plugin to the mp4 format for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_from_mp4"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
tempfile = "3.2.0"
|
||||
mp4 = "0.9.0"
|
||||
|
||||
|
@ -4,17 +4,17 @@ description = "A converter plugin to the bson format for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_from_sqlite"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bigdecimal = { package = "bigdecimal", version = "0.3.0", features = ["serde"] }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
tempfile = "3.2.0"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
|
@ -4,17 +4,17 @@ description = "An S3 plugin for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_s3"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
futures = { version="0.3.12", features=["compat", "io-compat"] }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
s3handler = "0.7.5"
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -4,17 +4,17 @@ description = "A plugin to open files/URLs directly from Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_start"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
glob = "0.3.0"
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
url = "2.2.0"
|
||||
webbrowser = "0.5.5"
|
||||
|
||||
@ -22,5 +22,5 @@ webbrowser = "0.5.5"
|
||||
open = "1.4.0"
|
||||
|
||||
[build-dependencies]
|
||||
nu-errors = { version = "0.66.1", path="../nu-errors" }
|
||||
nu-source = { version = "0.66.1", path="../nu-source" }
|
||||
nu-errors = { version = "0.66.2", path="../nu-errors" }
|
||||
nu-source = { version = "0.66.2", path="../nu-source" }
|
||||
|
@ -4,17 +4,17 @@ description = "A converter plugin to the bson format for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_to_bson"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bson = { version = "2.0.1", features = [ "chrono-0_4" ] }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
num-traits = "0.2.14"
|
||||
|
||||
[features]
|
||||
|
@ -4,17 +4,17 @@ description = "A converter plugin to the SQLite format for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_to_sqlite"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
hex = "0.4.2"
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-source = { path="../nu-source", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
nu-source = { path="../nu-source", version = "0.66.2" }
|
||||
tempfile = "3.2.0"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
|
@ -4,16 +4,16 @@ description = "Tree viewer plugin for Nushell"
|
||||
edition = "2018"
|
||||
license = "MIT"
|
||||
name = "nu_plugin_tree"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
derive-new = "0.5.8"
|
||||
nu-errors = { path="../nu-errors", version = "0.66.1" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.1" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.1" }
|
||||
nu-errors = { path="../nu-errors", version = "0.66.2" }
|
||||
nu-plugin = { path="../nu-plugin", version = "0.66.2" }
|
||||
nu-protocol = { path="../nu-protocol", version = "0.66.2" }
|
||||
ptree = { version = "0.4.0", default-features = false }
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
authors = ["Nu authors"]
|
||||
edition = "2018"
|
||||
name = "wasm"
|
||||
version = "0.66.1"
|
||||
version = "0.66.2"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
BIN
wix/License.rtf
BIN
wix/License.rtf
Binary file not shown.
Reference in New Issue
Block a user