Add droid and cursor sync targets, extract shared path helpers

- 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>
This commit is contained in:
Kieran Klaassen
2026-02-12 20:37:15 -08:00
parent 84af459c79
commit e41904a569
10 changed files with 322 additions and 95 deletions

17
src/utils/resolve-home.ts Normal file
View File

@@ -0,0 +1,17 @@
import os from "os"
import path from "path"
export function expandHome(value: string): string {
if (value === "~") return os.homedir()
if (value.startsWith(`~${path.sep}`)) {
return path.join(os.homedir(), value.slice(2))
}
return value
}
export function resolveTargetHome(value: unknown, defaultPath: string): string {
if (!value) return defaultPath
const raw = String(value).trim()
if (!raw) return defaultPath
return path.resolve(expandHome(raw))
}