feat(omo-codex): sync shared skills into plugin
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
import { cp, mkdir, rm } from "node:fs/promises";
|
||||
import { cp, mkdir, readdir, rm } from "node:fs/promises";
|
||||
import { dirname, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = dirname(dirname(fileURLToPath(import.meta.url)));
|
||||
const sharedSkillsRoot = join(root, "..", "..", "shared-skills", "skills");
|
||||
const skillSources = [
|
||||
["comment-checker", "components/comment-checker/skills/comment-checker"],
|
||||
["lsp", "components/lsp/skills/lsp"],
|
||||
@@ -17,3 +18,13 @@ await mkdir(join(root, "skills"), { recursive: true });
|
||||
for (const [name, source] of skillSources) {
|
||||
await cp(join(root, source), join(root, "skills", name), { recursive: true });
|
||||
}
|
||||
|
||||
const sharedSkillEntries = await readdir(sharedSkillsRoot, { withFileTypes: true });
|
||||
const sharedSkillNames = sharedSkillEntries
|
||||
.filter((entry) => entry.isDirectory())
|
||||
.map((entry) => entry.name)
|
||||
.sort();
|
||||
|
||||
for (const skillName of sharedSkillNames) {
|
||||
await cp(join(sharedSkillsRoot, skillName), join(root, "skills", skillName), { recursive: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user