@join-pantheon/cli 0.32.0-rc.3 → 0.32.0-rc.4
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
CHANGED
|
@@ -94,14 +94,15 @@ 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) {
|
|
98
|
-
|
|
97
|
+
export function finishAfterExit(paths, pids = [process.pid, process.ppid]) {
|
|
98
|
+
const script = cleanupScript(paths, pids);
|
|
99
|
+
if (!script)
|
|
99
100
|
return false;
|
|
100
101
|
try {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
detached: true, stdio: "ignore", windowsHide: true, windowsVerbatimArguments: true,
|
|
102
|
+
const child = spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-WindowStyle", "Hidden", "-Command", script], {
|
|
103
|
+
detached: true, stdio: "ignore", windowsHide: true,
|
|
104
104
|
});
|
|
105
|
+
child.on("error", () => { });
|
|
105
106
|
child.unref();
|
|
106
107
|
return true;
|
|
107
108
|
}
|
|
@@ -109,6 +110,16 @@ export function finishAfterExit(paths) {
|
|
|
109
110
|
return false;
|
|
110
111
|
}
|
|
111
112
|
}
|
|
113
|
+
export function cleanupScript(paths, pids) {
|
|
114
|
+
if (!paths.length || paths.some((x) => /[\r\n]/.test(x)))
|
|
115
|
+
return null;
|
|
116
|
+
const ids = pids.filter((n) => Number.isInteger(n) && n > 0);
|
|
117
|
+
return [
|
|
118
|
+
ids.length ? `Wait-Process -Id ${ids.join(",")} -Timeout 60 -ErrorAction SilentlyContinue` : "",
|
|
119
|
+
"Start-Sleep -Milliseconds 500",
|
|
120
|
+
`Remove-Item -LiteralPath ${paths.map((x) => `'${x.replace(/'/g, "''")}'`).join(",")} -Recurse -Force -ErrorAction SilentlyContinue`,
|
|
121
|
+
].filter(Boolean).join("; ");
|
|
122
|
+
}
|
|
112
123
|
export function removeManagedInstall(o) {
|
|
113
124
|
const fs = o.fs ?? realUninstallFs;
|
|
114
125
|
const env = o.env ?? process.env;
|
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.4",
|
|
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": {
|