diff --git a/CHANGELOG.md b/CHANGELOG.md index 090b448c2..29bcef977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ - [Rust](https://github.com/moonrepo/rust-plugin/blob/master/CHANGELOG.md) - [TOML schema](https://github.com/moonrepo/schema-plugin/blob/master/CHANGELOG.md) +## Unreleased + +#### 🐞 Fixes + +- Fixed an issue where version detection would read files found in `node_modules` (which you usually don't want). + ## 0.22.1 #### 🐞 Fixes diff --git a/crates/core/src/tool.rs b/crates/core/src/tool.rs index cbbacf52c..6495493dd 100644 --- a/crates/core/src/tool.rs +++ b/crates/core/src/tool.rs @@ -546,6 +546,11 @@ impl Tool { return Ok(None); } + // TODO move this into plugins + if current_dir.to_string_lossy().contains("node_modules") { + return Ok(None); + } + let has_parser = self.plugin.has_func("parse_version_file"); let result: DetectVersionOutput = self.plugin.cache_func("detect_version_files")?;