mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-03 04:07:03 +00:00
fix: the opencv cache follows HYPERFRAMES_CACHE_DIR
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user