This commit is contained in:
Rizky
2024-06-26 15:03:13 +07:00
parent 96dbca0e55
commit 2b9c84270f
7 changed files with 22 additions and 20 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ function removeQuotes(str: string) {
}
/** Parse an envfile string. */
export function parse(src: string): Data {
export function parseEnv(src: string): Data {
const result: Data = {};
const lines = splitInLines(src);
for (const line of lines) {
@@ -35,7 +35,7 @@ export function parse(src: string): Data {
}
/** Turn an object into an envfile string. */
export function stringify(obj: Input): string {
export function genEnv(obj: Input): string {
let result = "";
for (const [key, value] of Object.entries(obj)) {
if (key) {
+2 -2
View File
@@ -4,12 +4,12 @@ import { $ } from "execa";
import { g } from "./global";
export const preparePrisma = async () => {
if ((await existsAsync(dir("app/db/.env"))) && !g.db) {
if (process.env.DATABASE_URL && !g.db) {
try {
if (g.mode !== "dev") {
await $({ cwd: dir(`app/db`) })`bun prisma generate`;
}
const { PrismaClient } = await import("../../app/db/db");
g.db = new PrismaClient();
} catch (e) {