feat(install): 支持 --system 与 --user 模式切换并自动清理残留二进制
- 在 scripts/install.sh 中默认安装至用户目录 ~/.local/bin,并自动清理历史遗留的 /opt/homebrew/bin/seal-use - 在 scripts/dev-override.ts 中优先命中 ~/.local/bin/seal-use,忽略 Homebrew 路径并自动清理残留 - 在 seal-use update 中支持 --system(提权迁移至 /usr/local/bin)与 --user(降权回归至 ~/.local/bin)选项,添加 seal-use migrate 别名 - 迁移与更新时自动清理另一端的非活动实体二进制(恪守 Single Binary Invariant) - 自更新权限预检:当目标位于系统目录且缺少写权限时,友好提示 sudo seal-use update 而非底层报错 - 在 seal-use doctor 中增加执行模式识别与多份二进制(PATH 阴影)检测告警
This commit is contained in:
1 parent
477cc630b4
commit
87bb10f527
12 files changed
+294
-34
No files matched your search
@@ -161,6 +161,19 @@ describe("CLI version & help handling", () => {
|
||||
expect(parsed.version).toBe(VERSION);
|
||||
}, 20000);
|
||||
|
||||
test("migrate command without target flags shows usage error", () => {
|
||||
const result = runCli(["migrate"]);
|
||||
expect(result.status).toBe(2);
|
||||
expect(result.stderr).toContain("Usage: seal-use migrate --system | --user");
|
||||
});
|
||||
|
||||
test("update help shows system and user migration options", () => {
|
||||
const result = runCli(["update", "--help"]);
|
||||
expect(result.status).toBe(0);
|
||||
expect(result.stdout).toContain("--system");
|
||||
expect(result.stdout).toContain("--user");
|
||||
});
|
||||
|
||||
test("mcp-config outputs valid mcp configuration json", () => {
|
||||
const result = runCli(["mcp-config"]);
|
||||
expect(result.status).toBe(0);
|
||||
|
||||
Reference in new issue
Block a user