mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
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:
@@ -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)",
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user