@join-pantheon/cli 0.32.0-rc.4 → 0.32.0-rc.6
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/uninstall.js +15 -11
- package/helper/macos/prebuilt/manifest.json +1 -1
- package/package.json +1 -1
package/dist/uninstall.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execFileSync,
|
|
1
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync, rmdirSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { platform } from "node:os";
|
|
4
4
|
import { posix, win32 } from "node:path";
|
|
@@ -94,31 +94,35 @@ export function managedInstall(home, os = platform(), env = process.env, fs = re
|
|
|
94
94
|
const log = os === "win32" ? p.join(root, "install.log") : p.join(root, "logs", "install.log");
|
|
95
95
|
return { os, root, runtime, binDir, launcher, log, present: fs.exists(runtime) || fs.exists(launcher) };
|
|
96
96
|
}
|
|
97
|
-
export function finishAfterExit(paths, pids = [process.pid
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
97
|
+
export function finishAfterExit(paths, pids = [process.pid]) {
|
|
98
|
+
const inner = cleanupScript(paths, pids);
|
|
99
|
+
if (!inner)
|
|
100
100
|
return false;
|
|
101
|
+
const ps = `${process.env.SystemRoot ?? "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
101
102
|
try {
|
|
102
|
-
const
|
|
103
|
-
|
|
103
|
+
const r = spawnSync(ps, ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", cleanupLauncher(ps, inner)], {
|
|
104
|
+
windowsHide: true, stdio: "ignore", timeout: 30_000,
|
|
104
105
|
});
|
|
105
|
-
|
|
106
|
-
child.unref();
|
|
107
|
-
return true;
|
|
106
|
+
return r.status === 0;
|
|
108
107
|
}
|
|
109
108
|
catch {
|
|
110
109
|
return false;
|
|
111
110
|
}
|
|
112
111
|
}
|
|
112
|
+
export function cleanupLauncher(ps, inner) {
|
|
113
|
+
const enc = Buffer.from(inner, "utf16le").toString("base64");
|
|
114
|
+
return `Start-Process -FilePath '${ps.replace(/'/g, "''")}' -WindowStyle Hidden -ArgumentList '-NoProfile','-NonInteractive','-ExecutionPolicy','Bypass','-EncodedCommand','${enc}'`;
|
|
115
|
+
}
|
|
113
116
|
export function cleanupScript(paths, pids) {
|
|
114
117
|
if (!paths.length || paths.some((x) => /[\r\n]/.test(x)))
|
|
115
118
|
return null;
|
|
116
119
|
const ids = pids.filter((n) => Number.isInteger(n) && n > 0);
|
|
117
|
-
|
|
120
|
+
const steps = [
|
|
118
121
|
ids.length ? `Wait-Process -Id ${ids.join(",")} -Timeout 60 -ErrorAction SilentlyContinue` : "",
|
|
119
122
|
"Start-Sleep -Milliseconds 500",
|
|
120
|
-
`Remove-Item -LiteralPath ${paths.map((x) => `'${x.replace(/'/g, "''")}'`).join(",")} -Recurse -Force
|
|
123
|
+
`Remove-Item -LiteralPath ${paths.map((x) => `'${x.replace(/'/g, "''")}'`).join(",")} -Recurse -Force`,
|
|
121
124
|
].filter(Boolean).join("; ");
|
|
125
|
+
return `& { ${steps} } *> (Join-Path $env:TEMP 'pantheon-uninstall.log')`;
|
|
122
126
|
}
|
|
123
127
|
export function removeManagedInstall(o) {
|
|
124
128
|
const fs = o.fs ?? realUninstallFs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@join-pantheon/cli",
|
|
3
|
-
"version": "0.32.0-rc.
|
|
3
|
+
"version": "0.32.0-rc.6",
|
|
4
4
|
"description": "Let your coding agent collaborate directly with your teammates' agents — ask, agree an interface, and deliver, without a human relaying messages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|