| 5843 | } |
| 5844 | |
| 5845 | static int cbm_remove_qwen_lifecycle_hooks(const char *settings_path, const char *binary_path, |
| 5846 | bool windows) { |
| 5847 | char command[CLI_BUF_8K]; |
| 5848 | char released_command[CLI_BUF_8K]; |
| 5849 | char shell[CLI_BUF_32]; |
| 5850 | if (cbm_build_qwen_hook_command(binary_path, windows, command, sizeof(command), shell, |
| 5851 | sizeof(shell)) != CLI_OK || |
| 5852 | (windows ? cbm_build_augment_command_windows(binary_path, released_command, |
| 5853 | sizeof(released_command)) |
| 5854 | : cbm_build_augment_command(binary_path, released_command, |
| 5855 | sizeof(released_command))) != CLI_OK) { |
| 5856 | return CLI_ERR; |
| 5857 | } |
| 5858 | int lifecycle_result = cbm_remove_paired_lifecycle_hooks_json(settings_path, command); |
| 5859 | int legacy_result = cbm_remove_paired_lifecycle_hooks_json(settings_path, released_command); |
| 5860 | int read_result = remove_hooks_json((hooks_remove_args_t){ |
| 5861 | .settings_path = settings_path, |
| 5862 | .hook_event = "PostToolUse", |
| 5863 | .matcher_str = "ReadFile", |
| 5864 | .match_command_exact = command, |
| 5865 | }); |
| 5866 | return lifecycle_result == CLI_OK && legacy_result == CLI_OK && read_result == CLI_OK ? CLI_OK |
| 5867 | : CLI_ERR; |
| 5868 | } |
| 5869 | |
| 5870 | static int cbm_upsert_factory_hooks(const char *settings_path, const char *binary_path) { |
| 5871 | char command[CLI_BUF_8K]; |
no test coverage detected