mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
fix: normalize paths to forward slashes for Windows RegExp compatibility
Windows path.relative() produces backslashes (e.g., memory\2026-02-16.md)
which fail to match RegExp patterns using forward slashes.
Normalize relative paths to forward slashes before RegExp matching
using rel.split(path.sep).join('/').
Fixes 4 test failures on Windows CI.
This commit is contained in:
@@ -30,7 +30,9 @@ export function auditPostCompactionReads(
|
||||
// RegExp — match against relative paths from workspace
|
||||
const found = readFilePaths.some((p) => {
|
||||
const rel = path.relative(workspaceDir, path.resolve(workspaceDir, p));
|
||||
return required.test(rel);
|
||||
// Normalize to forward slashes for cross-platform RegExp matching
|
||||
const normalizedRel = rel.split(path.sep).join("/");
|
||||
return required.test(normalizedRel);
|
||||
});
|
||||
if (!found) {
|
||||
missingPatterns.push(required.source);
|
||||
|
||||
Reference in New Issue
Block a user