mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(cli): a preview's session follows HYPERFRAMES_CACHE_DIR when it is set * docs(cli): background previews follow HYPERFRAMES_CACHE_DIR * test(cli): unstub the preview test's env in a block body * test(cli): clear HYPERFRAMES_CACHE_DIR in the CLI's test home * fix(cli): registry cache, search model, catalog and catch-up follow HYPERFRAMES_CACHE_DIR * style(cli): format the media search cache test * test(cli): compare the model path against an absolute cache folder on Windows too * fix(cli): both catalog readers treat an empty HYPERFRAMES_CATALOG_ARTIFACT_DIR as unset
12 lines
459 B
TypeScript
12 lines
459 B
TypeScript
import { homedir } from "node:os";
|
|
import { join, resolve } from "node:path";
|
|
|
|
export function hyperframesCacheDir(...parts: string[]): string {
|
|
const named = process.env["HYPERFRAMES_CACHE_DIR"];
|
|
return join(named ? resolve(named) : join(homedir(), ".cache", "hyperframes"), ...parts);
|
|
}
|
|
|
|
export function namedCacheDir(...parts: string[]): string | undefined {
|
|
return process.env["HYPERFRAMES_CACHE_DIR"] ? hyperframesCacheDir(...parts) : undefined;
|
|
}
|