feat(cli): 添加 update 命令支持自更新 - #44
Merged
Merged
Conversation
源码模式(bun link)执行 git pull + bun install + bun run build; 全局安装模式检测 npm/pnpm/yarn/bun 安装来源后委派对应包管理器, 并显式传递安装 prefix,避免 PATH 上的包管理器与当初安装的 prefix 不一致(nvm 切版本、brew npm 等场景)导致装到别处。 - 安装来源检测拆为纯函数并补测试,pnpm 因实包存放于与 node_modules 同级的 .pnpm 虚拟目录,改为按全局根目录判定且不依赖目录版本号 - 更新命令 argv 由 package-manager-detector 生成,全局目录解析复用 global-directory(其 npm.prefix 依赖 node execPath,编译模式下不可用) - 子进程 stdin 改为 inherit 以支持 git 凭证与 sudo 输入 - 安装失败时探测 prefix 可写性,不可写则提示改用 sudo - 无法确定安装来源时明确报错并给出手动更新命令,不猜测包管理器
tyanxie
force-pushed
the
feat/update-command
branch
from
August 9, 2026 09:11
fd8c676 to
9a17d04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.