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

@@ -58,6 +58,19 @@ describe('getInstallationInfo', () => {
process.argv = originalArgv;
});
it('should detect running as a standalone binary', () => {
vi.stubEnv('IS_BINARY', 'true');
process.argv[1] = '/path/to/binary';
const info = getInstallationInfo(projectRoot, true);
expect(info.packageManager).toBe(PackageManager.BINARY);
expect(info.isGlobal).toBe(true);
expect(info.updateMessage).toBe(
'Running as a standalone binary. Please update by downloading the latest version from GitHub.',
);
expect(info.updateCommand).toBeUndefined();
vi.unstubAllEnvs();
});
it('should return UNKNOWN when cliPath is not available', () => {
process.argv[1] = '';
const info = getInstallationInfo(projectRoot, true);