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