MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / update_clear_indexes

Function update_clear_indexes

src/cli/cli.c:4219–4238  ·  view source on GitHub ↗

Prompt to delete existing indexes. Returns 0 to continue, 1 to abort. */

Source from the content-addressed store, hash-verified

4217
4218/* Prompt to delete existing indexes. Returns 0 to continue, 1 to abort. */
4219static int update_clear_indexes(const char *home, bool dry_run) {
4220 int index_count = count_db_indexes(home);
4221 if (index_count == 0) {
4222 return 0;
4223 }
4224 printf("Found %d existing index(es) that must be rebuilt after update:\n", index_count);
4225 cbm_list_indexes(home);
4226 printf("\n");
4227 if (dry_run) {
4228 printf("(dry-run — indexes would be deleted)\n\n");
4229 return 0;
4230 }
4231 if (!prompt_yn("Delete these indexes and continue with update?")) {
4232 printf("Update cancelled.\n");
4233 return CLI_TRUE;
4234 }
4235 int removed = cbm_remove_indexes(home);
4236 printf("Removed %d index(es).\n\n", removed);
4237 return 0;
4238}
4239
4240/* Download, verify checksum, kill old instances, and install binary. Returns 0 on success. */
4241static int download_verify_install(const char *url, const char *ext, const char *os,

Callers 1

cbm_cmd_updateFunction · 0.85

Calls 4

count_db_indexesFunction · 0.85
cbm_list_indexesFunction · 0.85
prompt_ynFunction · 0.85
cbm_remove_indexesFunction · 0.85

Tested by

no test coverage detected