fix(cli): ignore update cache in managed install doctor

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-07-22 19:41:03 +00:00
1 parent d851c2e6c0
commit aff4e184cb
2 files changed
+23 -3

No files matched your search

@@ -4,6 +4,7 @@ import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { managedInstallChecks } from "../checks/managed-install-check.js";
import {
MANAGED_STORE_MARKER,
buildNextManifest,
flipCurrentAtomic,
resolveInstallStorePaths,
@@ -51,9 +52,24 @@ describe("managed install doctor checks", () => {
homeDir: root,
});
fs.mkdirSync(paths.cliRoot, { recursive: true });
fs.writeFileSync(paths.markerPath, MANAGED_STORE_MARKER);
expect(managedInstallChecks(paths)).toEqual([
expect.objectContaining({ name: "Managed install manifest", status: "fail" }),
]);
});
it("ignores the shared CLI directory when it only contains update notice state", () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), "paperclip-install-doctor-"));
const paths = resolveInstallStorePaths({
paperclipHome: path.join(root, ".paperclip"),
homeDir: root,
});
fs.mkdirSync(paths.cliRoot, { recursive: true });
fs.writeFileSync(path.join(paths.cliRoot, "update-check.json"), "{}\n");
expect(managedInstallChecks(paths)).toEqual([
expect.objectContaining({ name: "Managed install", status: "pass" }),
]);
});
});
+7 -3
View File
@@ -17,9 +17,13 @@ function pathContains(directory: string): boolean {
}
function hasManagedArtifacts(paths: InstallStorePaths): boolean {
return [paths.cliRoot, paths.manifestPath, paths.currentPath, paths.shimPath].some((entry) =>
fs.existsSync(entry),
);
return [
paths.installsRoot,
paths.manifestPath,
paths.markerPath,
paths.currentPath,
paths.shimPath,
].some((entry) => fs.existsSync(entry));
}
export function nodeRuntimeCheck(): CheckResult {