create-dwy 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sync.js +5 -2
package/package.json
CHANGED
package/src/sync.js
CHANGED
|
@@ -275,11 +275,14 @@ export async function syncClaude(opts = {}) {
|
|
|
275
275
|
let selectedSkills, selectedRules, selectedCommands, selectedHooks
|
|
276
276
|
|
|
277
277
|
if (useCache && hasAnyExisting) {
|
|
278
|
-
//
|
|
278
|
+
// 缓存模式:模板 ∩ 已选 覆盖同步
|
|
279
279
|
selectedSkills = skills.filter(s => existingSkills.has(s.name))
|
|
280
280
|
selectedRules = rules.filter(r => existingRules.has(r.name))
|
|
281
281
|
selectedCommands = commands.filter(c => existingCommands.has(c.name))
|
|
282
|
-
|
|
282
|
+
// hooks 与 settings.json 引用配套:从未装过则装全部模板 hooks,已装过则按已选覆盖
|
|
283
|
+
selectedHooks = existingHooks.size > 0
|
|
284
|
+
? hooks.filter(h => existingHooks.has(h.name))
|
|
285
|
+
: hooks
|
|
283
286
|
console.log(chalk.gray(`使用已选缓存覆盖同步(如需调整请加 --no-cache):`))
|
|
284
287
|
console.log(chalk.gray(` ${selectedSkills.length} skills, ${selectedRules.length} rules, ${selectedCommands.length} commands, ${selectedHooks.length} hooks\n`))
|
|
285
288
|
} else {
|