From dcda2d06ac54acfdf1fd6284569f096671a64f6d Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Sat, 24 Jun 2023 09:04:54 +0200 Subject: [PATCH] :green_heart: Fix prisma schema path evaluation on windows Closes #573 --- packages/prisma/scripts/executeCommand.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/prisma/scripts/executeCommand.ts b/packages/prisma/scripts/executeCommand.ts index 5b0c0b97c..f0be4a775 100644 --- a/packages/prisma/scripts/executeCommand.ts +++ b/packages/prisma/scripts/executeCommand.ts @@ -1,13 +1,20 @@ import { exec } from 'child_process' -import { join } from 'path' +import { join, relative } from 'path' require('dotenv').config({ override: true, path: join(__dirname, `../.env`), }) -const postgesqlSchemaPath = join(__dirname, '../postgresql/schema.prisma') -const mysqlSchemaPath = join(__dirname, '../mysql/schema.prisma') +const postgesqlSchemaPath = relative( + process.cwd(), + join(__dirname, `../postgresql/schema.prisma`) +) + +const mysqlSchemaPath = relative( + process.cwd(), + join(__dirname, `../mysql/schema.prisma`) +) type Options = { force?: boolean