Bun Spawn -> node child process in tools and seed versioning
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Extract the `version` field from YAML frontmatter.
|
||||
* Returns 0 if no version is found.
|
||||
*/
|
||||
export function parseSeedVersion(content: string): number {
|
||||
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
||||
if (!match) return 0;
|
||||
const versionMatch = match[1]!.match(/^version:\s*(\d+)/m);
|
||||
return versionMatch ? parseInt(versionMatch[1]!, 10) : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user