Skip to content

Commit

Permalink
(fix) remove async and rename project to project_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
2color authored and Jolg42 committed May 11, 2020
1 parent cfd1bcf commit fc52517
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/packages/cli/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ async function main(): Promise<number> {
// Project hash is a SHA256 of the schemaPath
const projectHash = await getProjectHash()
// SHA256 of the cli path
const cliPathHash = await getCLIPathHash()
const cliPathHash = getCLIPathHash()

// check prisma for updates
const checkResult = await checkpoint.check({
product: 'prisma',
cli_path_hash: cliPathHash,
project: projectHash,
project_hash: projectHash,
version: packageJson.version,
disable: ci.isCI,
})
Expand Down Expand Up @@ -222,11 +222,12 @@ async function getProjectHash(): Promise<string> {
.digest('hex')
.substring(0, 8)
}

/**
* Get a unique identifier for the CLI installation path
* which can be either global or local (in project's node_modules)
*/
async function getCLIPathHash(): Promise<string> {
function getCLIPathHash(): string {
const cliPath = process.argv[1]
return crypto
.createHash('sha256')
Expand Down

0 comments on commit fc52517

Please sign in to comment.