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.
- package/dist/update.js +5 -3
- 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
|
-
//
|
|
69
|
-
//
|
|
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("
|
|
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);
|