Skip to content

Commit

Permalink
Fix getCwd
Browse files Browse the repository at this point in the history
  • Loading branch information
Errorname committed Jul 24, 2019
1 parent 34b2eac commit c5f2f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/cli/src/getCwd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ export async function getCwd(): Promise<string> {
const cwd = process.cwd()
const [
datamodelCwdExists,
schemaCwdExists,
prismaFolderExists,
prismaDatamodelExists,
prismaSchemaExists
] = await Promise.all([
exists(path.join(cwd, datamodelFile)),
exists(path.join(cwd, schemaFile)),
Expand All @@ -27,11 +29,11 @@ export async function getCwd(): Promise<string> {
exists(path.join(cwd, 'prisma/', schemaFile)),
])

if (datamodelCwdExists) {
if (datamodelCwdExists || schemaCwdExists) {
return cwd
}

if (prismaFolderExists || prismaDatamodelExists) {
if (prismaFolderExists || prismaDatamodelExists || prismaSchemaExists) {
return path.join(cwd, 'prisma/')
}

Expand Down

0 comments on commit c5f2f35

Please sign in to comment.