Remove nu-glob's dependency on nu-protocol (#15349)

# Description

This PR solves a circular dependency issue (`nu-test-support` needs
`nu-glob` which needs `nu-protocol` which needs `nu-test-support`). This
was done by making the glob functions that any type that implements
`Interruptible` to remove the dependency on `Signals`.

# After Submitting

Make `Paths.next()` a O(1) operation so that cancellation/interrupt
handling can be moved to the caller (e.g., by wrapping the `Paths`
iterator in a cancellation iterator).
This commit is contained in:
Ian Manske
2025-03-20 09:32:41 -07:00
committed by GitHub
parent b241e9edd5
commit dfba62da00
8 changed files with 81 additions and 59 deletions

View File

@ -1,6 +1,6 @@
use super::Director;
use crate::fs::{self, Stub};
use nu_glob::glob;
use nu_glob::{glob, Uninterruptible};
#[cfg(not(target_arch = "wasm32"))]
use nu_path::Path;
use nu_path::{AbsolutePath, AbsolutePathBuf};
@ -231,7 +231,7 @@ impl Playground<'_> {
}
pub fn glob_vec(pattern: &str) -> Vec<std::path::PathBuf> {
let glob = glob(pattern, None);
let glob = glob(pattern, Uninterruptible);
glob.expect("invalid pattern")
.map(|path| {