From a90a5fe4a2518b9624d5445c443f5077d8700d90 Mon Sep 17 00:00:00 2001 From: Rizky Date: Fri, 28 Jun 2024 00:46:03 +0700 Subject: [PATCH] fix --- pkgs/api/_deploy.ts | 5 ++++- pkgs/prod.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/api/_deploy.ts b/pkgs/api/_deploy.ts index 42f736a..d561762 100644 --- a/pkgs/api/_deploy.ts +++ b/pkgs/api/_deploy.ts @@ -108,8 +108,11 @@ export const _ = { ); try { + await Bun.write( + dir("app/db/.env"), + `DATABASE_URL=${process.env.DATABASE_URL}` + ); await $({ cwd: dir("app/db") })`bun install`; - await $({})`cp -f .env app/db`; await $({ cwd: dir("app/db") })`bun prisma db pull --force`; await $({ cwd: dir("app/db") })`bun prisma generate`; await Bun.write( diff --git a/pkgs/prod.ts b/pkgs/prod.ts index e5d8338..32aeaff 100644 --- a/pkgs/prod.ts +++ b/pkgs/prod.ts @@ -38,8 +38,11 @@ console.log("Process Manager running at port:", port); if (process.env.DATABASE_URL) { if (!(await existsAsync(dir("node_modules/.prisma")))) { try { + await Bun.write( + dir("app/db/.env"), + `DATABASE_URL=${process.env.DATABASE_URL}` + ); await $({ cwd: dir(`app/db`) })`bun install`; - await $({ })`cp -f .env app/db`; await $({ cwd: dir(`app/db`) })`bun prisma db pull --force`; await $({ cwd: dir(`app/db`) })`bun prisma generate`; } catch (e) {