@ppdocs/mcp 2.6.7 → 2.6.8
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/dist/cli.js +6 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -242,7 +242,6 @@ function generateHooksConfig() {
|
|
|
242
242
|
hooks: {
|
|
243
243
|
UserPromptSubmit: [
|
|
244
244
|
{
|
|
245
|
-
matcher: '*',
|
|
246
245
|
hooks: [{ type: 'command', command }]
|
|
247
246
|
}
|
|
248
247
|
]
|
|
@@ -266,12 +265,12 @@ function installClaudeTemplates(cwd) {
|
|
|
266
265
|
copyDirRecursive(srcHooks, destHooks);
|
|
267
266
|
console.log(`✅ Installed .claude/hooks/`);
|
|
268
267
|
}
|
|
269
|
-
// 3. 生成跨平台 hooks 配置并合并到 settings.
|
|
270
|
-
const
|
|
268
|
+
// 3. 生成跨平台 hooks 配置并合并到 settings.json (hooks 必须在 settings.json 才能生效)
|
|
269
|
+
const settingsPath = path.join(claudeDir, 'settings.json');
|
|
271
270
|
let existingSettings = {};
|
|
272
|
-
if (fs.existsSync(
|
|
271
|
+
if (fs.existsSync(settingsPath)) {
|
|
273
272
|
try {
|
|
274
|
-
existingSettings = JSON.parse(fs.readFileSync(
|
|
273
|
+
existingSettings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
275
274
|
}
|
|
276
275
|
catch { /* ignore */ }
|
|
277
276
|
}
|
|
@@ -281,8 +280,8 @@ function installClaudeTemplates(cwd) {
|
|
|
281
280
|
...hooksConfig
|
|
282
281
|
};
|
|
283
282
|
fs.mkdirSync(claudeDir, { recursive: true });
|
|
284
|
-
fs.writeFileSync(
|
|
285
|
-
console.log(`✅ Configured .claude/settings.
|
|
283
|
+
fs.writeFileSync(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
|
284
|
+
console.log(`✅ Configured .claude/settings.json hooks (${process.platform})`);
|
|
286
285
|
}
|
|
287
286
|
/** 安装 Codex 模板 (生成 AGENTS.md) */
|
|
288
287
|
function installCodexTemplates(cwd) {
|