fix(cli): correctly handle auto-update for standalone binaries (#23038)

This commit is contained in:
Bryan Morgan
2026-03-18 21:52:23 -04:00
committed by GitHub
parent 5fa14dbe42
commit 8db2948361
4 changed files with 36 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ export enum PackageManager {
BUNX = 'bunx',
HOMEBREW = 'homebrew',
NPX = 'npx',
BINARY = 'binary',
UNKNOWN = 'unknown',
}
@@ -41,6 +42,16 @@ export function getInstallationInfo(
}
try {
// Check for standalone binary first
if (process.env['IS_BINARY'] === 'true') {
return {
packageManager: PackageManager.BINARY,
isGlobal: true,
updateMessage:
'Running as a standalone binary. Please update by downloading the latest version from GitHub.',
};
}
// Normalize path separators to forward slashes for consistent matching.
const realPath = fs.realpathSync(cliPath).replace(/\\/g, '/');
const normalizedProjectRoot = projectRoot?.replace(/\\/g, '/');