fix: handle the case sensitive in mac screenshot name (#2021)

This commit is contained in:
Yingjie He
2025-04-03 06:20:38 -07:00
committed by GitHub
parent 96bcaa146c
commit 4c76124b4e

View File

@@ -838,7 +838,7 @@ impl DeveloperRouter {
if let Some(filename) = path.file_name().and_then(|f| f.to_str()) { if let Some(filename) = path.file_name().and_then(|f| f.to_str()) {
// Check if this matches Mac screenshot pattern: // Check if this matches Mac screenshot pattern:
// "Screenshot YYYY-MM-DD at H.MM.SS AM/PM.png" // "Screenshot YYYY-MM-DD at H.MM.SS AM/PM.png"
if let Some(captures) = regex::Regex::new(r"^Screenshot \d{4}-\d{2}-\d{2} at \d{1,2}\.\d{2}\.\d{2} (AM|PM)(?: \(\d+\))?\.png$") if let Some(captures) = regex::Regex::new(r"^Screenshot \d{4}-\d{2}-\d{2} at \d{1,2}\.\d{2}\.\d{2} (AM|PM|am|pm)(?: \(\d+\))?\.png$")
.ok() .ok()
.and_then(|re| re.captures(filename)) .and_then(|re| re.captures(filename))
{ {