Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions scripts/check-skills-index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ function parseSkillsIndex(content) {
let currentSkill = null
let inSections = false

for (const line of lines) {
for (let i = 0; i < lines.length; i++) {
const line = lines[i]
const skillMatch = /^ {2}([\w-]+):\s*$/.exec(line)
if (skillMatch) {
currentSkill = skillMatch[1]
skills[currentSkill] = { sections: [], lineNumber: lines.indexOf(line) + 1 }
skills[currentSkill] = { sections: [], lineNumber: i + 1 }
inSections = false
continue
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/sync-plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ function injectDeprecationNotice(content, notice, label) {
if (currentDesc.startsWith(notice)) {
return content
}
const newFm = fm.replace(/^description:[ \t]*(.*)$/m, `description: ${notice}${currentDesc}`)
return content.replace(fmMatch[0], `---\n${newFm}\n---`)
const newFm = fm.replace(/^description:[ \t]*(.*)$/m, (_, matchedDesc) => {
return `description: ${notice}${matchedDesc}`
})
return content.replace(fmMatch[0], () => `---\n${newFm}\n---`)
}

async function loadLocalPlugins() {
Expand Down