fix env
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user