Check if hooks are installed globally in `~/.claude/settings.json`.
(&self)
| 160 | |
| 161 | /// Check if hooks are installed globally in `~/.claude/settings.json`. |
| 162 | pub fn is_installed_global(&self) -> bool { |
| 163 | let settings_path = match Self::global_settings_path() { |
| 164 | Some(p) => p, |
| 165 | None => return false, |
| 166 | }; |
| 167 | |
| 168 | if !settings_path.exists() { |
| 169 | return false; |
| 170 | } |
| 171 | |
| 172 | match settings::read_settings(&settings_path) { |
| 173 | Ok((_, hooks)) => { |
| 174 | settings::has_any_atomic_hook(&hooks.session_start) |
| 175 | || settings::has_any_atomic_hook(&hooks.session_end) |
| 176 | || settings::has_any_atomic_hook(&hooks.stop) |
| 177 | || settings::has_any_atomic_hook(&hooks.user_prompt_submit) |
| 178 | || settings::has_any_atomic_hook(&hooks.pre_tool_use) |
| 179 | || settings::has_any_atomic_hook(&hooks.post_tool_use) |
| 180 | } |
| 181 | Err(_) => false, |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | impl Default for ClaudeCodeHook { |
nothing calls this directly
no test coverage detected