fix: the opencv cache follows HYPERFRAMES_CACHE_DIR

This commit is contained in:
Miguel Angel Simon Sierra
2026-10-31 17:17:10 -04:00
parent 4cef924cbf
commit cd2cc26ab1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -3,14 +3,14 @@
// Haar face models, pinned by size and sha256, into ~/.cache/hyperframes/opencv/<version>/.
import { mkdirSync, readFileSync, renameSync, rmSync } from "node:fs";
import { createRequire } from "node:module";
import { homedir } from "node:os";
import { join } from "node:path";
import { hyperframesCacheDir } from "@hyperframes/core/cache-dir";
import { downloadToFile } from "../cloud/download.js";
import { verifies, type ModelFile } from "../whisper/modelFile.js";
import { Fix } from "./media.js";
const VERSION = "4.10.0";
export const OPENCV_DIR = join(homedir(), ".cache", "hyperframes", "opencv", VERSION);
export const OPENCV_DIR = hyperframesCacheDir("opencv", VERSION);
interface Pinned extends ModelFile {
url: string;
+2 -2
View File
@@ -22,11 +22,11 @@ describe("hyperframesCacheDir", () => {
});
});
/** Source files under every package's src, tests left out. */
/** Source files under every package's src, tests and test helpers left out. */
function sources(dir: string): string[] {
return readdirSync(dir, { recursive: true, withFileTypes: true })
.filter((entry) => entry.isFile() && /\.(m?[jt]sx?)$/.test(entry.name))
.filter((entry) => !/\.test\.|__tests__/.test(join(entry.parentPath, entry.name)))
.filter((entry) => !/\.test[.-]|__tests__/.test(join(entry.parentPath, entry.name)))
.map((entry) => join(entry.parentPath, entry.name));
}