u1s1-cli 0.13.1 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/update.js +5 -3
  2. package/package.json +1 -1
package/dist/update.js CHANGED
@@ -65,11 +65,13 @@ async function portableSelfUpdate(latest) {
65
65
  if (process.platform === "win32") {
66
66
  console.log(`正在打开更新窗口(升级到 v${latest})…`);
67
67
  console.log("更新在新窗口里进行,本窗口会退出;装完后重新打开终端运行 u1s1 即可。");
68
- // 命令写进临时 .ps1 start,避开 cmd/start 对内联命令的引号地狱;
69
- // start 的第一个引号参数是窗口标题,必须占位,否则带空格的路径会被吞掉
68
+ // 不走 `cmd /c start`:start 只把**带引号**的首参当窗口标题,而 node 对
69
+ // 无空格参数不加引号,标题会被当成命令执行(0.13.1 翻车现场)。node 在
70
+ // Windows 上 detached + stdio ignore 的子进程自带新控制台,直接 spawn
71
+ // powershell 即可,参数按 Win32 规则原样传递,没有二次解析。
70
72
  const tmp = join(mkdtempSync(join(tmpdir(), "u1s1-update-")), "update.ps1");
71
73
  writeFileSync(tmp, "irm https://u1s1.io/releases/install.ps1 | iex\n");
72
- const child = spawn("cmd.exe", ["/c", "start", "u1s1", "powershell", "-NoProfile", "-ExecutionPolicy", "Bypass", "-NoExit", "-File", tmp], { detached: true, stdio: "ignore" });
74
+ const child = spawn("powershell.exe", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-NoExit", "-File", tmp], { detached: true, stdio: "ignore" });
73
75
  child.unref();
74
76
  // 立刻退出释放 node.exe 的文件锁,让安装器能替换安装目录
75
77
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u1s1-cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "u1s1 — 有一说一,最省心的 AI 编程搭子。终端里用中文说需求,AI 帮你读文件、改代码、跑命令。",
5
5
  "type": "module",
6
6
  "bin": {