ralph-review 0.1.8 → 0.1.9
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/lib/self-update.ts +6 -0
package/package.json
CHANGED
package/src/lib/self-update.ts
CHANGED
|
@@ -50,6 +50,7 @@ const BREW_INSTALLED_VERSION_ERROR =
|
|
|
50
50
|
"Could not determine the installed Homebrew version for ralph-review.";
|
|
51
51
|
const BREW_LATEST_VERSION_ERROR =
|
|
52
52
|
"Could not determine the latest Homebrew version for ralph-review.";
|
|
53
|
+
const BREW_UPDATE_ERROR = "Failed to refresh Homebrew metadata for ralph-review.";
|
|
53
54
|
const NPM_INSTALLED_VERSION_ERROR =
|
|
54
55
|
"Could not determine the installed npm version for ralph-review.";
|
|
55
56
|
const VERSION_COMPARE_ERROR =
|
|
@@ -474,6 +475,10 @@ async function getBrewVersions(
|
|
|
474
475
|
return parseBrewVersions(output);
|
|
475
476
|
}
|
|
476
477
|
|
|
478
|
+
async function refreshBrewMetadata(deps: SelfUpdateDependencies): Promise<void> {
|
|
479
|
+
await readTextOutput(deps, ["brew", "update", "--quiet"], BREW_UPDATE_ERROR);
|
|
480
|
+
}
|
|
481
|
+
|
|
477
482
|
async function performNpmSelfUpdate(
|
|
478
483
|
options: SelfUpdateOptions,
|
|
479
484
|
deps: SelfUpdateDependencies
|
|
@@ -521,6 +526,7 @@ async function performBrewSelfUpdate(
|
|
|
521
526
|
deps: SelfUpdateDependencies
|
|
522
527
|
): Promise<SelfUpdateResult> {
|
|
523
528
|
ensureManagerAvailable("brew", deps);
|
|
529
|
+
await refreshBrewMetadata(deps);
|
|
524
530
|
|
|
525
531
|
const { currentVersion, latestVersion } = await getBrewVersions(deps);
|
|
526
532
|
if (!hasNewerVersion(currentVersion, latestVersion)) {
|