Skip to content

Commit

Permalink
only install @prisma/client with existing package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jan 16, 2020
1 parent 5f6cd8b commit d75db24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cli/sdk/src/predefinedGeneratorResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ The provider has been renamed to "prisma-client-js" and the package to "@prisma/
console.log({ prismaClientDir })
}

if (!fs.existsSync(path.join(process.cwd(), 'package.json'))) {
throw new PrismaClientFacadeMissingError()
}

if (!prismaClientDir) {
if (
!fs.existsSync(path.join(process.cwd(), 'package.json')) &&
!fs.existsSync(path.join(process.cwd(), '../package.json'))
) {
throw new PrismaClientFacadeMissingError()
}
if (!process.stdout.isTTY) {
throw new PrismaClientFacadeMissingError()
} else {
Expand Down

0 comments on commit d75db24

Please sign in to comment.