chore: Return error if the regex is invalid
This commit is contained in:
@@ -28,7 +28,7 @@ fn find_repos(
|
|||||||
let mut warnings = Vec::new();
|
let mut warnings = Vec::new();
|
||||||
|
|
||||||
let exlusion_regex: regex::Regex = regex::Regex::new(&exclusion_pattern.unwrap_or(r"^$"))
|
let exlusion_regex: regex::Regex = regex::Regex::new(&exclusion_pattern.unwrap_or(r"^$"))
|
||||||
.unwrap_or_else(|_| regex::Regex::new(r"^$").unwrap());
|
.map_err(|e| format!("invalid regex: {e}"))?;
|
||||||
for path in tree::find_repo_paths(root)? {
|
for path in tree::find_repo_paths(root)? {
|
||||||
if exclusion_pattern.is_some() && exlusion_regex.is_match(&path::path_as_string(&path)) {
|
if exclusion_pattern.is_some() && exlusion_regex.is_match(&path::path_as_string(&path)) {
|
||||||
warnings.push(format!("[skipped] {}", &path::path_as_string(&path)));
|
warnings.push(format!("[skipped] {}", &path::path_as_string(&path)));
|
||||||
|
|||||||
Reference in New Issue
Block a user