fix: update formula handling in SKILL.md and frontmatter.ts (#11046)

- Changed "cask" to "formula" in SKILL.md for consistency.
- Enhanced formula parsing in frontmatter.ts to trim whitespace and fallback to cask if formula is not provided.
This commit is contained in:
Val Alexander
2026-02-19 16:57:08 -06:00
committed by GitHub
parent 4883aa5439
commit 82a1741336
2 changed files with 8 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ metadata:
{
"id": "brew-cask",
"kind": "brew",
"cask": "steipete/tap/codexbar",
"formula": "steipete/tap/codexbar",
"bins": ["codexbar"],
"label": "Install CodexBar (brew cask)",
},

View File

@@ -45,8 +45,13 @@ function parseInstallSpec(input: unknown): SkillInstallSpec | undefined {
if (osList.length > 0) {
spec.os = osList;
}
if (typeof raw.formula === "string") {
spec.formula = raw.formula;
const formula = typeof raw.formula === "string" ? raw.formula.trim() : "";
if (formula) {
spec.formula = formula;
}
const cask = typeof raw.cask === "string" ? raw.cask.trim() : "";
if (!spec.formula && cask) {
spec.formula = cask;
}
if (typeof raw.package === "string") {
spec.package = raw.package;