MCPcopy
hub / github.com/prisma/prisma / getProjectHash

Function getProjectHash

packages/internals/src/cli/hashes.ts:9–14  ·  view source on GitHub ↗
(schemaPath: SchemaPathInput)

Source from the content-addressed store, hash-verified

7 * the directory with `schema.prisma`
8 */
9export async function getProjectHash(schemaPath: SchemaPathInput): Promise<string> {
10 // Default to cwd if the schema couldn't be found
11 const projectPath = (await getSchemaWithPath({ schemaPath }))?.schemaPath ?? process.cwd()
12
13 return crypto.createHash('sha256').update(projectPath).digest('hex').substring(0, 8)
14}
15
16/**
17 * Get a unique identifier for the CLI installation path

Callers 2

parseMethod · 0.90
runCheckpointClientCheckFunction · 0.90

Calls 3

getSchemaWithPathFunction · 0.90
digestMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected