fix: ccb update 使用 bun install -g @latest 替代 bun update -g

bun update -g 只更新到 package.json 版本范围内的最新版,无法跨版本升级。
改为 bun install -g @latest 与 npm 侧行为一致,强制拉取最新发布版。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-05-03 19:28:16 +08:00
parent 40fbc4afc4
commit 2545dcabfd

View File

@@ -129,7 +129,7 @@ export async function updateCCB(): Promise<void> {
try {
if (pkgManager === 'bun') {
execSync(`bun update -g ${PACKAGE_NAME}`, {
execSync(`bun install -g ${PACKAGE_NAME}@latest`, {
stdio: 'inherit',
cwd: homedir(),
timeout: 120_000,
@@ -153,7 +153,9 @@ export async function updateCCB(): Promise<void> {
process.stderr.write('\n')
process.stderr.write('Try manually updating with:\n')
if (pkgManager === 'bun') {
process.stderr.write(chalk.bold(` bun update -g ${PACKAGE_NAME}`) + '\n')
process.stderr.write(
chalk.bold(` bun install -g ${PACKAGE_NAME}@latest`) + '\n',
)
} else {
process.stderr.write(
chalk.bold(` npm install -g ${PACKAGE_NAME}@latest`) + '\n',