mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:04:31 +00: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
|
// RegExp — match against relative paths from workspace
|
||||||
const found = readFilePaths.some((p) => {
|
const found = readFilePaths.some((p) => {
|
||||||
const rel = path.relative(workspaceDir, path.resolve(workspaceDir, 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) {
|
if (!found) {
|
||||||
missingPatterns.push(required.source);
|
missingPatterns.push(required.source);
|
||||||
|
|||||||
Reference in New Issue
Block a user