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

Function build_update_url

src/cli/cli.c:11296–11311  ·  view source on GitHub ↗

Update-only helpers. The release build hands updating to the install * script, so none of this ships: no release URL construction, no archive * download, no extract-and-exec. Retained for the C suite, which still * covers the flow through the activation test seam. */ Build the download URL for the update command. */

Source from the content-addressed store, hash-verified

11294 * covers the flow through the activation test seam. */
11295/* Build the download URL for the update command. */
11296static void build_update_url(char *url, int url_sz, const char *os, const char *arch,
11297 const char *ext, bool want_ui) {
11298 char base_url_buf[CLI_BUF_512];
11299 const char *base_url =
11300 cbm_safe_getenv("CBM_DOWNLOAD_URL", base_url_buf, sizeof(base_url_buf), NULL);
11301 if (!base_url || !base_url[0]) {
11302 base_url = "https://github.com/DeusData/codebase-memory-mcp/releases/latest/download";
11303 }
11304 /* Linux ships a fully-static "-portable" build; the standard linux binary
11305 * dynamically links glibc 2.38+ and fails on older distros. macOS/Windows
11306 * have no such variant. Keep in sync with install.sh / install.js / pypi
11307 * _cli.py. */
11308 const char *portable = (strcmp(os, "linux") == 0) ? "-portable" : "";
11309 snprintf(url, url_sz, "%s/codebase-memory-mcp-%s%s-%s%s.%s", base_url, want_ui ? "ui-" : "", os,
11310 arch, portable, ext);
11311}
11312
11313/* Confirm index deletion before network I/O, but defer the deletion itself to
11314 * the final guarded activation after the verified binary is ready. Returns 0

Callers 1

cbm_cmd_updateFunction · 0.85

Calls 1

cbm_safe_getenvFunction · 0.85

Tested by

no test coverage detected