Dashboard › cli › Distillation
6d24d04b-e349-4e2a-9259-6651717add30["lore_tm_v1_Ayno8TaRQ_6UXci0h_rMjkEm5rRkFRSSFcjITWL7Skg","lore_tm_v1_z5v9kvyUeiAuYQ7mlOSMCqC0Nk3cpuIBQXwLdxgCl8o","lore_tm_v1_S_bJU232sSKgEsUujBhyE-D75Ui_9Ydhr3wj0RD_IAQ","lore_tm_v1_-y9BNThn9tX4eKQ0l8vmL8Dyco9uFwjhu6L-ufmIsRU","lore_tm_v1_mV_QAlWF15ryQp_28BxODNjilqL6SeWwE7weyP88_AM","lore_tm_v1_9Bdr3YxSqGrnV7O7dQrC_kOiKh522_z2UcY4cDfvt3k","lore_tm_v1_sMqb8KsR72xUPpFYclOFPvoHWYOIChjTONYjz1lxxyQ","lore_tm_v1_rpkvTWMWg0lkFZvBVrZibtSq6Ce-ootZgD_EzwUOgCA"]
packages/cli/src/lib/binary.ts, stripTrailingSep(p) strips one trailing platform separator only when p.length > 1, never from a bare root like /, so PATH entries such as ~/.local/bin/ compare equal to ~/.local/bin.packages/cli/src/lib/binary.ts defines IS_CASE_INSENSITIVE_FS once at module load as true for win32 and darwin; exported samePath(a, b) tolerates trailing separators and compares lowercase paths on case-insensitive filesystems, avoiding a per-call platform check.packages/cli/src/lib/binary.ts defines LEGACY_INSTALL_SUBDIR = join(".sentry", "bin") and LEGACY_INSTALL_SUBDIRS = [LEGACY_INSTALL_SUBDIR]; migration is deliberately limited to pre-XDG ~/.sentry/bin, excluding current install targets ~/.local/bin and ~/bin.getLegacyInstallDirs(homeDir) maps every entry in LEGACY_INSTALL_SUBDIRS through join(homeDir, dir).InstallationMethod supports "curl", "brew", "npm", "pnpm", "bun", "yarn", and "unknown"; parseInstallationMethod(value) lowercases input, accepts the first 6 methods through VALID_METHODS, and otherwise throws Invalid method: ${value}. Must be one of: ${VALID_METHODS.join(", ")}.isMusl() in packages/cli/src/lib/binary.ts caches its result, returns false outside Linux, first checks /lib/ld-musl-${muslArch}.so.1 where muslArch is x86_64 for x64 and aarch64 otherwise, then runs ldd --version and searches combined stdout/stderr for "musl"; if ldd fails, it assumes glibc.getPlatformBinaryName() produces sentry-<os>-<arch>[-musl][.exe]: OS is darwin, windows, or linux; architecture is arm64 or x64; musl adds -musl; Windows adds .exe.resolveUpgradeSource() returns the successful source-probe response to its caller so the caller never repeats the request.packages/cli/src/lib/binary.ts: isNightlyVersion(version) checks for "-dev."; compareVersions(a, b) delegates to semver.compare and returns -1 | 0 | 1; isDowngrade(current, target) is true when compareVersions(current, target) === 1; getBinaryFilename() returns "sentry.exe" on Windows and "sentry" elsewhere.GITHUB_RELEASES_URL references: packages/cli/src/lib/upgrade.ts import at line 29 and uses at lines 403 and 562; packages/cli/src/lib/release-notes.ts import at line 18 and use at line 564; packages/cli/src/lib/delta-upgrade.ts import at line 35 and uses at lines 124 and 159; and its definition in packages/cli/src/lib/binary.ts line 250.packages/cli/src/lib/upgrade.ts still uses module-level GITHUB_RELEASES_URL for ${GITHUB_RELEASES_URL}/latest at line 403 and ${GITHUB_RELEASES_URL}/tags/${version} at line 562.packages/cli/src/lib/release-notes.ts still uses module-level GITHUB_RELEASES_URL for ${GITHUB_RELEASES_URL}?per_page=${CHANGELOG_MAX_RELEASES} at line 564.packages/cli/src/lib/delta-upgrade.ts imports GHCR_REPO at line 44 and uses it at lines 135 and 288; packages/cli/src/lib/upgrade.ts calls getAnonymousToken() without a source at lines 476, 523, and 733, calls fetchNightlyManifest(token) at line 482, calls fetchManifest(token, \nightly-${version}`)at lines 525 and 735, callsfetchNightlyManifest(token)at line 736, and callsdownloadNightlyBlob(token, layer.digest)` at line 739.packages/cli/src/lib/ghcr.ts still defines GHCR_REPO = "getsentry/cli" at line 134; getAnonymousToken(signal?) builds token scope from GHCR_REPO at line 193, fetchManifest() builds manifest URLs from it at line 232, fetchNightlyManifest() delegates using GHCR_TAG at line 268, downloadNightlyBlob() builds blob URLs from it at line 337, tag listing builds URLs from it at line 432, and downloadLayerBlob() delegates to downloadNightlyBlob(token, digest, signal) at line 518.getBinaryDownloadUrl(version) is still called without a resolved source in packages/cli/src/lib/upgrade.ts line 766; other no-source calls occur in packages/cli/test/lib/upgrade.test.ts line 975 and packages/cli/test/lib/binary.test.ts lines 43 and 57.packages/cli/src/lib/version-check.ts handles stable version checks through GitHub Releases and nightly checks through GHCR OCI manifest annotations, caches results in the database, and displays them on subsequent runs.packages/cli/src/lib/version-check.ts imports fetchLatestFromGitHub and fetchLatestNightlyVersion from ./upgrade.js, plus prefetchNightlyPatches and prefetchStablePatches from ./delta-upgrade.js.CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000, NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000, and JITTER_FACTOR = 0.2; notifications are rate-limited to once per 24 hours.SUPPRESSED_ARGS in packages/cli/src/lib/version-check.ts contains, in order: "upgrade", "--version", "-V", "--json", "token", and "init"; "init" is suppressed because its interactive wizard has its own terminal UI.SUPPRESSED_CLI_SUBCOMMANDS contains "setup" and "fix" and is matched only when preceded by "cli" to avoid false positives such as --project setup.skipGlobalValueFlagValue(args, i) recognizes global value flags derived from GLOBAL_FLAGS, skips a following spaced value only when the flag has no = and the next token does not start with -, and otherwise leaves the index unchanged.GHCR_REPO: token URL assertion at packages/cli/test/lib/ghcr.test.ts:83, nightly manifest assertion at line 152, patch manifest assertion at line 404, tag-list assertion at line 447, and blob assertion at line 569.packages/cli/test/lib/delta-upgrade.test.ts contains coverage sections for fetchRecentReleases beginning at line 819, resolveStableChain beginning at line 893, resolveStableDelta beginning at line 1625, attemptDeltaUpgrade beginning at line 1812, prefetchNightlyPatches beginning at line 1827, and prefetchStablePatches beginning at line 1838.