summaryrefslogtreecommitdiff
path: root/cli/util/glob.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-01-13 10:39:22 -0500
committerGitHub <noreply@github.com>2024-01-13 10:39:22 -0500
commitdaed58855775b4da042272a296b500d9b9e76e7d (patch)
treeae5312c8bff3ecb71d2a97d9e291f1018cd2baec /cli/util/glob.rs
parent0b9c06b632f25454f4aace8565830195e8320677 (diff)
fix(config): regression - handle relative patterns with leading dot slash (#21922)
This is a hacky quick fix. We need to spend more time cleaning up this code and push more stuff down into deno_config. Closes #21916
Diffstat (limited to 'cli/util/glob.rs')
-rw-r--r--cli/util/glob.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/util/glob.rs b/cli/util/glob.rs
index 7bd600167..4fe8a9a0a 100644
--- a/cli/util/glob.rs
+++ b/cli/util/glob.rs
@@ -248,9 +248,11 @@ impl GlobPattern {
}
pub fn new(pattern: &str) -> Result<Self, AnyError> {
- let pattern =
- glob::Pattern::new(&escape_brackets(pattern).replace('\\', "/"))
- .with_context(|| format!("Failed to expand glob: \"{}\"", pattern))?;
+ let pattern = escape_brackets(pattern)
+ .replace('\\', "/")
+ .replace("/./", "/");
+ let pattern = glob::Pattern::new(&pattern)
+ .with_context(|| format!("Failed to expand glob: \"{}\"", pattern))?;
Ok(Self(pattern))
}