| 2141 | } |
| 2142 | |
| 2143 | static int cbm_upsert_session_hooks(const char *settings_path) { |
| 2144 | static const char *matchers[] = {"startup", "resume", "clear", "compact"}; |
| 2145 | char command[CLI_BUF_1K]; |
| 2146 | cbm_resolve_hook_command(CMM_SESSION_REMINDER_SCRIPT, command, sizeof(command)); |
| 2147 | int rc = 0; |
| 2148 | for (int i = 0; i < NUM_DIRS; i++) { |
| 2149 | if (upsert_hooks_json((hooks_upsert_args_t){.settings_path = settings_path, |
| 2150 | .hook_event = "SessionStart", |
| 2151 | .matcher_str = matchers[i], |
| 2152 | .command_str = command}) != 0) { |
| 2153 | rc = CLI_ERR; |
| 2154 | } |
| 2155 | } |
| 2156 | return rc; |
| 2157 | } |
| 2158 | |
| 2159 | static int cbm_remove_session_hooks(const char *settings_path) { |
| 2160 | static const char *matchers[] = {"startup", "resume", "clear", "compact"}; |
no test coverage detected