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

Function uninstall_vscode_profile_configs

src/cli/cli.c:9928–9954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9926}
9927
9928static void uninstall_vscode_profile_configs(const char *code_user, const char *binary_path,
9929 bool dry_run) {
9930 char profiles_dir[CLI_BUF_1K];
9931 snprintf(profiles_dir, sizeof(profiles_dir), "%s/profiles", code_user);
9932 cbm_dir_t *directory = cbm_opendir(profiles_dir);
9933 if (!directory) {
9934 return;
9935 }
9936 cbm_dirent_t *entry;
9937 while ((entry = cbm_readdir(directory)) != NULL) {
9938 if (strcmp(entry->name, ".") == 0 || strcmp(entry->name, "..") == 0) {
9939 continue;
9940 }
9941 char profile_dir[CLI_BUF_1K];
9942 snprintf(profile_dir, sizeof(profile_dir), "%s/%s", profiles_dir, entry->name);
9943 struct stat state;
9944 if (stat(profile_dir, &state) != 0 || !S_ISDIR(state.st_mode)) {
9945 continue;
9946 }
9947 char config_path[CLI_BUF_1K];
9948 snprintf(config_path, sizeof(config_path), "%s/mcp.json", profile_dir);
9949 if (!dry_run && cbm_remove_vscode_mcp_owned(binary_path, config_path) != CLI_OK) {
9950 record_agent_config_error(true, "VS Code", "profile_mcp_uninstall", config_path);
9951 }
9952 }
9953 cbm_closedir(directory);
9954}
9955
9956static bool cbm_filename_has_suffix(const char *name, const char *suffix) {
9957 size_t name_len = strlen(name);

Callers 1

uninstall_editor_agentsFunction · 0.85

Calls 6

cbm_opendirFunction · 0.85
cbm_readdirFunction · 0.85
cbm_closedirFunction · 0.85
statClass · 0.70

Tested by

no test coverage detected