File tree Expand file tree Collapse file tree
packages/app/control/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- echo " Generating AUTH_SECRET..."
4- AUTH_SECRET=$( node -e " console.log('AUTH_SECRET=' + require('crypto').randomBytes(32).toString('base64'))" )
5- echo $AUTH_SECRET
3+ # Check if .env file exists and if AUTH_SECRET is already set
4+ if [ -f .env ] && grep -q " ^AUTH_SECRET=" .env; then
5+ echo " AUTH_SECRET already exists in .env file. Skipping generation."
6+ else
7+ echo " Generating AUTH_SECRET..."
8+ AUTH_SECRET=$( node -e " console.log('AUTH_SECRET=' + require('crypto').randomBytes(32).toString('base64'))" )
9+ echo $AUTH_SECRET
10+ echo $AUTH_SECRET >> .env
11+ fi
612
7- echo $AUTH_SECRET >> .env
8- echo " DATABASE_URL='postgresql://echo_user:echo_password@localhost:5469/echo_control_v2?schema=public'" >> .env
13+ # Check if DATABASE_URL is already set
14+ if [ -f .env ] && grep -q " ^DATABASE_URL=" .env; then
15+ echo " DATABASE_URL already exists in .env file. Skipping."
16+ else
17+ echo " DATABASE_URL='postgresql://echo_user:echo_password@localhost:5469/echo_control_v2?schema=public'" >> .env
18+ fi
919
1020echo " Setup complete! You can now run 'pnpm dev' to start the development server."
11-
21+ No newline at end of file
You can’t perform that action at this time.
0 commit comments