mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 17:45:53 +01:00
fix(cli): ignore update cache in managed install doctor
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
5b61cf1f63
commit
ade8761ae3
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" }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user