(schemaPath: SchemaPathInput)
| 7 | * the directory with `schema.prisma` |
| 8 | */ |
| 9 | export 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 |
no test coverage detected