cc-viewer 1.5.22 → 1.5.23

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.
Files changed (2) hide show
  1. package/cli.js +6 -4
  2. package/package.json +2 -2
package/cli.js CHANGED
@@ -114,12 +114,14 @@ function installShellHook(isNative) {
114
114
  let content = existsSync(configPath) ? readFileSync(configPath, 'utf-8') : '';
115
115
 
116
116
  if (content.includes(SHELL_HOOK_START)) {
117
- // Check if existing hook matches desired mode
118
- const isNativeHook = content.includes('ccv run -- claude');
119
- if (!!isNative === !!isNativeHook) {
117
+ const hook = buildShellHook(isNative);
118
+ // Extract existing hook content
119
+ const regex = new RegExp(`${SHELL_HOOK_START}[\\s\\S]*?${SHELL_HOOK_END}`);
120
+ const existingMatch = content.match(regex);
121
+ if (existingMatch && existingMatch[0] === hook) {
120
122
  return { path: configPath, status: 'exists' };
121
123
  }
122
- // Mismatch: remove old hook first
124
+ // Hook content differs: remove old and reinstall
123
125
  removeShellHook();
124
126
  content = existsSync(configPath) ? readFileSync(configPath, 'utf-8') : '';
125
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.5.22",
3
+ "version": "1.5.23",
4
4
  "description": "Claude Code Logger visualization management tool",
5
5
  "license": "MIT",
6
6
  "main": "server.js",
@@ -95,4 +95,4 @@
95
95
  "undici": "^7.22.0",
96
96
  "ws": "^8.19.0"
97
97
  }
98
- }
98
+ }