Skip to content

Commit

Permalink
Update postinstall script to use VERCEL_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkarimoff committed Feb 8, 2024
1 parent ee57cc7 commit b289df3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
DATABASE_URL=""

NEXT_PUBLIC_URL="http://localhost:3000"
NEXT_PUBLIC_VERCEL_ENV="production" # set to "development" or leave it empty for local development


# Uploadthing
UPLOADTHING_SECRET=""
Expand Down
4 changes: 2 additions & 2 deletions postinstall.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { execSync } from 'child_process';
// Always run prisma generate
execSync('prisma generate', { stdio: 'inherit' });

// Only run prisma db push if NEXT_PUBLIC_VERCEL_ENV is production
// Only run prisma db push if VERCEL_ENV is production
// eslint-disable-next-line no-process-env
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'production') {
if (process.env.VERCEL_ENV === 'production') {
execSync('prisma db push', { stdio: 'inherit' });
}

0 comments on commit b289df3

Please sign in to comment.