mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 15:31:01 +02:00
Nu glob (#4818)
* Fork glob. Normalise license holder * Fix more licenses * unwraps * bad doc test
This commit is contained in:
@ -6,9 +6,10 @@ edition = "2021"
|
||||
[dependencies]
|
||||
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.59.1" }
|
||||
nu-path = { path = "../nu-path", version = "0.59.1" }
|
||||
nu-glob = { path = "../nu-glob", version = "0.59.1" }
|
||||
|
||||
itertools = "0.10.1"
|
||||
chrono = { version="0.4.19", features=["serde"] }
|
||||
glob = "0.3.0"
|
||||
|
||||
[features]
|
||||
plugin = []
|
||||
|
@ -5,7 +5,7 @@ use std::path::{Component, Path, PathBuf};
|
||||
use nu_path::{canonicalize_with, expand_path_with};
|
||||
use nu_protocol::{ShellError, Span, Spanned};
|
||||
|
||||
/// This function is like `glob::glob` from the `glob` crate, except it is relative to a given cwd.
|
||||
/// This function is like `nu_glob::glob` from the `glob` crate, except it is relative to a given cwd.
|
||||
///
|
||||
/// It returns a tuple of two values: the first is an optional prefix that the expanded filenames share.
|
||||
/// This prefix can be removed from the front of each value to give an approximation of the relative path
|
||||
@ -81,7 +81,7 @@ pub fn glob_from(
|
||||
|
||||
let pattern = pattern.to_string_lossy().to_string();
|
||||
|
||||
let glob = glob::glob(&pattern).map_err(|err| {
|
||||
let glob = nu_glob::glob(&pattern).map_err(|err| {
|
||||
nu_protocol::ShellError::SpannedLabeledError(
|
||||
"Error extracting glob pattern".into(),
|
||||
err.to_string(),
|
||||
|
Reference in New Issue
Block a user