Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ function inferExpectedSchema(filepath, { brainRoot } = {}) {
}

// Projects/<x>/<y>.md
const projMatch = rel.match(new RegExp(`^Projects\\${path.sep}([^${path.sep}]+)\\${path.sep}(.+)$`));
// path.sep on Windows is '\', which is invalid unescaped inside a RegExp character class.
const sep = path.sep.replace(/\\/g, '\\\\');
const projMatch = rel.match(new RegExp(`^Projects${sep}([^${sep}]+)${sep}(.+)$`));
if (projMatch) {
const projName = projMatch[1];
const subPath = projMatch[2];
Expand Down