Function
format_hook_warning
(command: &str, code: i32, stdout: Option<&str>, stderr: &str)
Source from the content-addressed store, hash-verified
| 216 | } |
| 217 | |
| 218 | fn format_hook_warning(command: &str, code: i32, stdout: Option<&str>, stderr: &str) -> String { |
| 219 | let mut message = |
| 220 | format!("Hook `{command}` exited with status {code}; allowing tool execution to continue"); |
| 221 | if let Some(stdout) = stdout.filter(|stdout| !stdout.is_empty()) { |
| 222 | message.push_str(": "); |
| 223 | message.push_str(stdout); |
| 224 | } else if !stderr.is_empty() { |
| 225 | message.push_str(": "); |
| 226 | message.push_str(stderr); |
| 227 | } |
| 228 | message |
| 229 | } |
| 230 | |
| 231 | fn shell_command(command: &str) -> CommandWithStdin { |
| 232 | #[cfg(windows)] |
Tested by
no test coverage detected