Dashboard › cli › Distillation
2264daba-172f-41b8-b7d9-cfa48314872c["lore_tm_v1_FC70g1SnBPYv9AzHYL-ry6KipPKBBaFQcpb-AVIs97c"]
packages/cli/src/lib/binary.ts importing UpgradeTransportError alongside stringifyUnknown and UpgradeError from ./errors.js.stripTrailingSep(p: string) strips a trailing path separator only when p.length > 1, never from a bare root like /, so PATH entries such as ~/.local/bin/ and ~/.local/bin compare equally.InstallationMethod in packages/cli/src/lib/binary.ts as "curl" | "brew" | "npm" | "pnpm" | "bun" | "yarn" | "unknown"; it resides alongside KNOWN_CURL_DIRS so both upgrade.ts and db/install-info.ts can import it without a circular dependency./lib/ld-musl-<arch>.so.1, the fast and more reliable dynamic-linker stat check; 2. parse ldd --version, where musl writes "musl libc" to stderr and glibc writes "GNU C Library" to stdout. The result is cached in cachedIsMusl because libc cannot change at runtime.GITHUB_RELEASES_URL from the hard-coded "https://api.github.com/repos/getsentry/cli/releases" to getGitHubReleasesUrl().packages/cli/src/lib/binary.ts, including an upgrade-source method that builds the URL whose response proves a source is available.resolveUpgradeSource(options: ResolveUpgradeSourceOptions): Promise<ResolvedUpgradeSource>, which iterates over options.sources ?? UPGRADE_SOURCES and calls fetchUpgradeProbe(source, options).resolveUpgradeSource() returns both the selected source and its successful response, so the caller never repeats the probe request.404 advances to the next source; any other HTTP failure throws UpgradeError("network_error", \Failed to fetch from GitHub: HTTP ${response.status}`), and network failures abort immediately. Exhausting all sources throws UpgradeSourceNotFoundError`.SENTRY_INSTALL_DIR as the first install-directory override in the environment-based install-directory resolution path.acquireLock(lockPath: string) in packages/cli/src/lib/binary.ts to call mkdirSync(dirname(lockPath), { recursive: true, mode: 0o755 }) before atomically creating the lock.acquireLock() parent-directory creation fixes ENOENT ... open '.../sentry.lock' when the derived install location does not yet exist or has been purged, including fresh ~/.sentry/bin, npm-to-nightly migration, and stale SENTRY_INSTALL_DIR cases tracked as CLI-1E1 and CLI-1RV.mkdirSync(dirname(lockPath), { recursive: true, mode: 0o755 }) outside acquireLock()’s lock-contention try/catch: genuine EEXIST, ENOTDIR, or EACCES directory errors must propagate directly rather than being passed to handleExistingLock and misinterpreted as lock contention, which could turn a real EEXIST into a misleading ENOTDIR.