@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `pi update` for pnpm global installs whose configured `global-bin-dir` no longer matches the active pnpm home ([#5689](https://github.com/earendil-works/pi/issues/5689)).
|
||||||
- Fixed inherited OpenCode/OpenCode Go completion model metadata to omit long-retention cache fields for routes that reject `prompt_cache_retention` ([#5702](https://github.com/earendil-works/pi/issues/5702)).
|
- Fixed inherited OpenCode/OpenCode Go completion model metadata to omit long-retention cache fields for routes that reject `prompt_cache_retention` ([#5702](https://github.com/earendil-works/pi/issues/5702)).
|
||||||
- Fixed custom provider config so plain uppercase API key and header values remain literals instead of being treated as legacy environment references; use explicit `$ENV_VAR` syntax for environment variables ([#5661](https://github.com/earendil-works/pi/issues/5661)).
|
- Fixed custom provider config so plain uppercase API key and header values remain literals instead of being treated as legacy environment references; use explicit `$ENV_VAR` syntax for environment variables ([#5661](https://github.com/earendil-works/pi/issues/5661)).
|
||||||
|
|
||||||
|
|||||||
@@ -109,19 +109,27 @@ function getSelfUpdateCommandForMethod(
|
|||||||
switch (method) {
|
switch (method) {
|
||||||
case "bun-binary":
|
case "bun-binary":
|
||||||
return undefined;
|
return undefined;
|
||||||
case "pnpm":
|
case "pnpm": {
|
||||||
|
const match = readCommandOutput("pnpm", ["root", "-g"])
|
||||||
|
? undefined
|
||||||
|
: /^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());
|
||||||
|
const binDirArgs = match
|
||||||
|
? [`--config.global-bin-dir=${process.env.PNPM_HOME || dirname(dirname(match[1]))}`]
|
||||||
|
: [];
|
||||||
return makeSelfUpdateCommand(
|
return makeSelfUpdateCommand(
|
||||||
makeSelfUpdateCommandStep("pnpm", [
|
makeSelfUpdateCommandStep("pnpm", [
|
||||||
"install",
|
"install",
|
||||||
"-g",
|
"-g",
|
||||||
"--ignore-scripts",
|
"--ignore-scripts",
|
||||||
"--config.minimumReleaseAge=0",
|
"--config.minimumReleaseAge=0",
|
||||||
|
...binDirArgs,
|
||||||
updatePackageName,
|
updatePackageName,
|
||||||
]),
|
]),
|
||||||
updatePackageName === installedPackageName
|
updatePackageName === installedPackageName
|
||||||
? undefined
|
? undefined
|
||||||
: makeSelfUpdateCommandStep("pnpm", ["remove", "-g", installedPackageName]),
|
: makeSelfUpdateCommandStep("pnpm", ["remove", "-g", ...binDirArgs, installedPackageName]),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
case "yarn":
|
case "yarn":
|
||||||
return makeSelfUpdateCommand(
|
return makeSelfUpdateCommand(
|
||||||
makeSelfUpdateCommandStep("yarn", ["global", "add", "--ignore-scripts", updatePackageName]),
|
makeSelfUpdateCommandStep("yarn", ["global", "add", "--ignore-scripts", updatePackageName]),
|
||||||
@@ -205,7 +213,9 @@ function getGlobalPackageRoots(method: InstallMethod, _packageName: string, npmC
|
|||||||
}
|
}
|
||||||
case "pnpm": {
|
case "pnpm": {
|
||||||
const root = readCommandOutput("pnpm", ["root", "-g"]);
|
const root = readCommandOutput("pnpm", ["root", "-g"]);
|
||||||
return root ? [root, dirname(root)] : [];
|
if (root) return [root, dirname(root)];
|
||||||
|
const match = /^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());
|
||||||
|
return match ? [match[1]] : [];
|
||||||
}
|
}
|
||||||
case "yarn": {
|
case "yarn": {
|
||||||
const dir = readCommandOutput("yarn", ["global", "dir"]);
|
const dir = readCommandOutput("yarn", ["global", "dir"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user