claude-code-tracker 1.2.1 → 1.2.2
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/install.sh +15 -18
- package/package.json +1 -1
package/install.sh
CHANGED
|
@@ -55,31 +55,28 @@ hook_entry = {"type": "command", "command": hook_cmd, "timeout": 30, "async": Tr
|
|
|
55
55
|
hooks = data.setdefault("hooks", {})
|
|
56
56
|
stop_hooks = hooks.setdefault("Stop", [])
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
for
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
else:
|
|
65
|
-
stop_hooks.append({"hooks": [hook_entry]})
|
|
58
|
+
# Remove any existing stop-hook.sh entries (from npm or brew) and replace with current path
|
|
59
|
+
stop_hooks[:] = [
|
|
60
|
+
g for g in stop_hooks
|
|
61
|
+
if not any("stop-hook.sh" in h.get("command", "") for h in g.get("hooks", []))
|
|
62
|
+
]
|
|
63
|
+
stop_hooks.append({"hooks": [hook_entry]})
|
|
66
64
|
|
|
67
|
-
# SessionStart hook
|
|
65
|
+
# SessionStart hook — same: remove old entries and replace
|
|
68
66
|
backfill_cmd = hook_cmd + " --backfill-only"
|
|
69
67
|
session_hooks = hooks.setdefault("SessionStart", [])
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
session_hooks.append({"hooks": [{"type": "command", "command": backfill_cmd, "timeout": 60, "async": True}]})
|
|
68
|
+
session_hooks[:] = [
|
|
69
|
+
g for g in session_hooks
|
|
70
|
+
if not any("stop-hook.sh" in h.get("command", "") for h in g.get("hooks", []))
|
|
71
|
+
]
|
|
72
|
+
session_hooks.append({"hooks": [{"type": "command", "command": backfill_cmd, "timeout": 60, "async": True}]})
|
|
76
73
|
|
|
77
|
-
# permissions.allow
|
|
74
|
+
# permissions.allow — clean old entries and add current
|
|
78
75
|
allow_entry = f"Bash({hook_cmd}*)"
|
|
79
76
|
perms = data.setdefault("permissions", {})
|
|
80
77
|
allow_list = perms.setdefault("allow", [])
|
|
81
|
-
if
|
|
82
|
-
|
|
78
|
+
allow_list[:] = [e for e in allow_list if "stop-hook.sh" not in e]
|
|
79
|
+
allow_list.append(allow_entry)
|
|
83
80
|
|
|
84
81
|
os.makedirs(os.path.dirname(os.path.abspath(settings_file)), exist_ok=True)
|
|
85
82
|
with open(settings_file, 'w') as f:
|