Compare commits

..

2 Commits

Author SHA1 Message Date
jkunz 0d05df8591 v2.19.7
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-06-05 17:08:20 +00:00
jkunz ae91c8f23d fix(tools): use pnpm update for global self updates 2026-06-05 17:03:16 +00:00
5 changed files with 57 additions and 6 deletions
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## 2026-06-05 - 2.19.7
### Fixes
- make global tool self-updates verify and use pnpm's update path
- Uses `pnpm update -g <package> --latest` before falling back to install for latest-version updates.
- Verifies installed package versions through `pnpm list -g` so pnpm v11 hash roots are handled correctly.
## 2026-06-05 - 2.19.6
### Fixes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@git.zone/cli",
"private": false,
"version": "2.19.6",
"version": "2.19.7",
"description": "A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/cli',
version: '2.19.6',
version: '2.19.7',
description: 'A comprehensive CLI tool for enhancing and managing local development workflows with gitzone utilities, focusing on project setup, version control, code formatting, and template management.'
}
+46 -3
View File
@@ -425,14 +425,48 @@ export class PackageManagerUtil {
return false;
}
const packageSpecifier = `${packageName}@${version}`;
console.log(` Installing ${packageSpecifier} via pnpm...`);
let effectiveVersion = version;
if (version === "latest") {
const latestVersion = await this.getLatestMatureVersion(packageName);
console.log(` Updating ${packageName} via pnpm...`);
try {
const updateResult = await this.shell.exec(
`${pnpmCommand} update -g ${shellQuote(packageName)} --latest`,
);
const installedVersion = await this.getCurrentInstalledPackageVersion(
packageName,
);
if (
updateResult.exitCode === 0 &&
installedVersion &&
(!latestVersion || installedVersion === latestVersion)
) {
return true;
}
} catch {
// Missing globals need an add instead of update.
}
effectiveVersion = latestVersion || version;
}
const packageSpecifier = `${packageName}@${effectiveVersion}`;
console.log(` Installing ${packageSpecifier} via pnpm...`);
try {
const result = await this.shell.exec(
`${pnpmCommand} add -g ${shellQuote(packageSpecifier)}`,
);
return result.exitCode === 0;
if (result.exitCode !== 0) {
return false;
}
if (effectiveVersion === "latest") {
return true;
}
const installedVersion = await this.getCurrentInstalledPackageVersion(
packageName,
);
return installedVersion === effectiveVersion;
} catch {
return false;
}
@@ -636,6 +670,15 @@ export class PackageManagerUtil {
return Array.from(packageMap.values());
}
private async getCurrentInstalledPackageVersion(
packageName: string,
): Promise<string | null> {
const installedPackage = (await this.getCurrentInstalledPackages()).find(
(packageInfo) => packageInfo.name === packageName,
);
return installedPackage?.version || null;
}
private async inspectGlobalRoot(
globalDir: string,
current: boolean,
+1 -1
View File
@@ -328,7 +328,7 @@ async function handleSelfUpdate(
return false;
}
const success = await pmUtil.installLatest("@git.zone/cli", latestVersion);
const success = await pmUtil.installLatest("@git.zone/cli");
if (!success) {
console.log(
"\ngitzone self-update failed. Continuing with the current version.\n",