File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 11import { config } from "dotenv" ;
22import type { Config } from "drizzle-kit" ;
33
4- const envPath =
5- process . env . NODE_ENV === "production" ? ".env.production" : ".env.local" ;
4+ const envPaths = {
5+ production : ".env.production" ,
6+ staging : ".env.staging" ,
7+ development : ".env.local" ,
8+ } ;
9+
10+ const envPath = envPaths [ process . env . NODE_ENV ] || ".env.local" ;
611
712config ( { path : envPath } ) ;
813
Original file line number Diff line number Diff line change 77 "test" : " jest" ,
88 "start" : " npx serverless offline" ,
99 "load-fixtures" : " ts-node src/scripts/loadBookFixtures.ts" ,
10+ "load-fixtures:staging" : " NODE_ENV=staging ts-node src/scripts/loadBookFixtures.ts" ,
1011 "load-fixtures:production" : " NODE_ENV=production ts-node src/scripts/loadBookFixtures.ts" ,
1112 "fetch-covers" : " ts-node src/scripts/fetchBookCovers.ts" ,
1213 "typeorm" : " typeorm-ts-node-commonjs"
Original file line number Diff line number Diff line change @@ -3,8 +3,14 @@ import { drizzle } from "drizzle-orm/node-postgres";
33import { Client } from "pg" ;
44import * as schema from "./schema" ;
55
6- const envPath =
7- process . env . NODE_ENV === "production" ? ".env.production" : ".env.local" ;
6+ const envPaths = {
7+ production : ".env.production" ,
8+ staging : ".env.staging" ,
9+ development : ".env.local" ,
10+ } ;
11+
12+ const envPath = envPaths [ process . env . NODE_ENV ] || ".env.local" ;
13+
814config ( { path : envPath } ) ;
915
1016export const client = new Client ( {
You can’t perform that action at this time.
0 commit comments