MCPcopy
hub / github.com/prisma/prisma / getCacheDir

Function getCacheDir

packages/fetch-engine/src/utils.ts:36–52  ·  view source on GitHub ↗
(channel: string, version: string, binaryTarget: string)

Source from the content-addressed store, hash-verified

34}
35
36export async function getCacheDir(channel: string, version: string, binaryTarget: string): Promise<string | null> {
37 const rootCacheDir = await getRootCacheDir()
38 if (!rootCacheDir) {
39 return null
40 }
41 const cacheDir = path.join(rootCacheDir, channel, version, binaryTarget)
42 try {
43 if (!fs.existsSync(cacheDir)) {
44 await ensureDir(cacheDir)
45 }
46 } catch (e) {
47 debug('The following error is being caught and just there for debugging:')
48 debug(e)
49 return null
50 }
51 return cacheDir
52}
53
54export function getDownloadUrl({
55 channel,

Callers 3

getCachedBinaryPathFunction · 0.90
saveFileToCacheFunction · 0.90
mainFunction · 0.90

Calls 2

getRootCacheDirFunction · 0.85
debugFunction · 0.85

Tested by

no test coverage detected