💚 Fix docker build prisma generate script
This commit is contained in:
@ -1,3 +1,3 @@
|
|||||||
import { executePrismaCommand } from './executeCommand'
|
import { executePrismaCommand } from './executeCommand'
|
||||||
|
|
||||||
executePrismaCommand('prisma generate')
|
executePrismaCommand('prisma generate', { force: true })
|
||||||
|
@ -9,8 +9,13 @@ require('dotenv').config({
|
|||||||
const postgesqlSchemaPath = join(__dirname, '../postgresql/schema.prisma')
|
const postgesqlSchemaPath = join(__dirname, '../postgresql/schema.prisma')
|
||||||
const mysqlSchemaPath = join(__dirname, '../mysql/schema.prisma')
|
const mysqlSchemaPath = join(__dirname, '../mysql/schema.prisma')
|
||||||
|
|
||||||
export const executePrismaCommand = (command: string) => {
|
type Options = {
|
||||||
const databaseUrl = process.env.DATABASE_URL
|
force?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export const executePrismaCommand = (command: string, options?: Options) => {
|
||||||
|
const databaseUrl =
|
||||||
|
process.env.DATABASE_URL ?? (options?.force ? 'postgresql://' : undefined)
|
||||||
|
|
||||||
if (!databaseUrl) {
|
if (!databaseUrl) {
|
||||||
console.error('Could not find DATABASE_URL in environment')
|
console.error('Could not find DATABASE_URL in environment')
|
||||||
|
Reference in New Issue
Block a user