mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-07-12 21:19:38 -04:00
Allow sync-agent-skills.mjs to match Windows line ends
This commit is contained in:
@@ -11,13 +11,13 @@ const outputDir = path.join(
|
||||
'docs/static/.well-known/agent-skills'
|
||||
);
|
||||
function readFrontmatter(markdown, sourcePath) {
|
||||
const match = markdown.match(/^---\n([\s\S]*?)\n---\n/);
|
||||
const match = markdown.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);
|
||||
if (!match) {
|
||||
throw new Error(`${sourcePath} is missing YAML frontmatter`);
|
||||
}
|
||||
|
||||
const frontmatter = {};
|
||||
for (const line of match[1].split('\n')) {
|
||||
for (const line of match[1].split(/\r?\n/)) {
|
||||
const field = line.match(/^([a-zA-Z0-9_-]+):\s*(.*)$/);
|
||||
if (field) {
|
||||
frontmatter[field[1]] = field[2].replace(/^"(.*)"$/, '$1');
|
||||
|
||||
Reference in New Issue
Block a user