- Add sync --target droid (skills to ~/.factory/skills/) - Add sync --target cursor (skills + MCP to .cursor/) - Extract expandHome/resolveTargetHome to src/utils/resolve-home.ts - Remove duplicated path helpers from convert.ts and install.ts - Bump version to 0.6.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
666 B
TypeScript
22 lines
666 B
TypeScript
import fs from "fs/promises"
|
|
import path from "path"
|
|
import type { ClaudeHomeConfig } from "../parsers/claude-home"
|
|
import { forceSymlink, isValidSkillName } from "../utils/symlink"
|
|
|
|
export async function syncToDroid(
|
|
config: ClaudeHomeConfig,
|
|
outputRoot: string,
|
|
): Promise<void> {
|
|
const skillsDir = path.join(outputRoot, "skills")
|
|
await fs.mkdir(skillsDir, { recursive: true })
|
|
|
|
for (const skill of config.skills) {
|
|
if (!isValidSkillName(skill.name)) {
|
|
console.warn(`Skipping skill with invalid name: ${skill.name}`)
|
|
continue
|
|
}
|
|
const target = path.join(skillsDir, skill.name)
|
|
await forceSymlink(skill.sourceDir, target)
|
|
}
|
|
}
|