From 5f8e66ec1e1ef9cceb135c560f9bd44c9269dd6b Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Sun, 12 Apr 2026 01:22:15 -0400 Subject: [PATCH 1/2] hotfix: detect bun-owned installs through symlinked ccs path --- src/utils/package-manager-detector.ts | 4 ++- .../utils/package-manager-detector.test.ts | 35 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/utils/package-manager-detector.ts b/src/utils/package-manager-detector.ts index 606c58ed..d5f4a051 100644 --- a/src/utils/package-manager-detector.ts +++ b/src/utils/package-manager-detector.ts @@ -29,7 +29,9 @@ export interface InstalledPackageState { const CCS_PACKAGE_NAME = '@kaitranntt/ccs'; function resolveScriptPath(scriptPath: string): string { - if (path.win32.isAbsolute(scriptPath)) { + // Keep Windows-style absolute test fixtures stable on non-Windows hosts, but + // still resolve real POSIX symlink paths such as ~/.bun/bin/ccs. + if (path.win32.isAbsolute(scriptPath) && !path.isAbsolute(scriptPath)) { return scriptPath; } diff --git a/tests/unit/utils/package-manager-detector.test.ts b/tests/unit/utils/package-manager-detector.test.ts index 693e0920..5bb1164a 100644 --- a/tests/unit/utils/package-manager-detector.test.ts +++ b/tests/unit/utils/package-manager-detector.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'bun:test'; -import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'fs'; +import { mkdtempSync, mkdirSync, realpathSync, rmSync, symlinkSync, writeFileSync } from 'fs'; import { tmpdir } from 'os'; import { join } from 'path'; import { @@ -72,6 +72,39 @@ describe('package-manager-detector', () => { expect(readInstalledPackageVersion(install)).toBe('7.67.0-dev.9'); }); + it.if(process.platform !== 'win32')( + 'detects bun installs from a POSIX symlinked ~/.bun/bin/ccs entrypoint', + () => { + const tempRoot = makeTempDir('ccs-install-detector-bun-symlink-'); + const packageRoot = join( + tempRoot, + '.bun', + 'install', + 'global', + 'node_modules', + '@kaitranntt', + 'ccs' + ); + const scriptPath = join(packageRoot, 'dist', 'ccs.js'); + const symlinkPath = join(tempRoot, 'home', '.bun', 'bin', 'ccs'); + + writePackage(packageRoot, '7.67.0-dev.9'); + mkdirSync(join(packageRoot, 'dist'), { recursive: true }); + writeFileSync(scriptPath, '#!/usr/bin/env node\n'); + mkdirSync(join(tempRoot, 'home', '.bun', 'bin'), { recursive: true }); + symlinkSync(scriptPath, symlinkPath); + + const install = detectCurrentInstall(symlinkPath); + const resolvedTempRoot = realpathSync(tempRoot); + const resolvedScriptPath = realpathSync(scriptPath); + + expect(install.manager).toBe('bun'); + expect(install.prefix).toBe(join(resolvedTempRoot, '.bun')); + expect(install.resolvedScriptPath).toBe(resolvedScriptPath); + expect(readInstalledPackageVersion(install)).toBe('7.67.0-dev.9'); + } + ); + it('detects custom bun install roots that still use install/global/node_modules', () => { const tempRoot = makeTempDir('ccs-install-detector-custom-bun-'); const packageRoot = join( From d725a3c06183c949b7598ff0145c0d5fd3e9d2d1 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 12 Apr 2026 05:34:46 +0000 Subject: [PATCH 2/2] chore(release): 7.68.1 [skip ci] ## [7.68.1](https://github.com/kaitranntt/ccs/compare/v7.68.0...v7.68.1) (2026-04-12) ### Hotfixes * detect bun-owned installs through symlinked ccs path ([5f8e66e](https://github.com/kaitranntt/ccs/commit/5f8e66ec1e1ef9cceb135c560f9bd44c9269dd6b)) --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d0df112..f7d62b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [7.68.1](https://github.com/kaitranntt/ccs/compare/v7.68.0...v7.68.1) (2026-04-12) + +### Hotfixes + +* detect bun-owned installs through symlinked ccs path ([5f8e66e](https://github.com/kaitranntt/ccs/commit/5f8e66ec1e1ef9cceb135c560f9bd44c9269dd6b)) + ## [7.68.0](https://github.com/kaitranntt/ccs/compare/v7.67.0...v7.68.0) (2026-04-11) ### Features diff --git a/package.json b/package.json index a58575f5..9fd19432 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kaitranntt/ccs", - "version": "7.68.0", + "version": "7.68.1", "description": "Claude Code Switch - Instant profile switching between Claude, GLM, Kimi, and more", "keywords": [ "cli",