portable-agent-layer 0.86.0 → 0.86.1
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/package.json +1 -1
- package/src/cli/index.ts +2 -1
- package/src/cli/reinstall.ts +13 -0
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -879,7 +879,8 @@ async function update() {
|
|
|
879
879
|
clearUpdateCache();
|
|
880
880
|
|
|
881
881
|
log.info("Reinstalling...");
|
|
882
|
-
|
|
882
|
+
const { reinstallInFreshProcess } = await import("./reinstall");
|
|
883
|
+
process.exit(reinstallInFreshProcess());
|
|
883
884
|
}
|
|
884
885
|
|
|
885
886
|
function cliDebug(args: string[]) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An update replaces PAL's files under a process that already holds the old
|
|
5
|
+
* modules in Bun's cache, so a new installer importing a new export would bind
|
|
6
|
+
* against the stale module and throw. A fresh process loads everything from disk.
|
|
7
|
+
*/
|
|
8
|
+
export function reinstallInFreshProcess(entry: string = process.argv[1]): number {
|
|
9
|
+
const run = spawnSync(process.execPath, [entry, "cli", "install"], {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
});
|
|
12
|
+
return run.status ?? 1;
|
|
13
|
+
}
|