mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-07-30 09:48:47 -04:00
Support .env.local override in run_local.sh for developer-specific configurations
This commit is contained in:
@@ -21,15 +21,20 @@ esac
|
||||
|
||||
WEB_DIR=web
|
||||
|
||||
# `.env.local` first: dotenv-cli loads the files in order and never overwrites an already-set
|
||||
# variable, so the first file listed wins. That makes `.env.local` the per-developer override of the
|
||||
# shared `.env`, matching Next.js' own precedence. A missing file is silently skipped.
|
||||
DOTENV_FILES=(-e .env.local -e .env)
|
||||
|
||||
if [ "$ENVIRONMENT" = "prod" ]; then
|
||||
npx dotenv -e .env -- npx concurrently \
|
||||
npx dotenv "${DOTENV_FILES[@]}" -- npx concurrently \
|
||||
-n API,NEXT,TS \
|
||||
-c white,magenta,cyan \
|
||||
"cross-env ENVIRONMENT=$NEXT_ENV yarn --cwd=backend/api prod" \
|
||||
"cross-env NEXT_PUBLIC_FIREBASE_ENV=$NEXT_ENV yarn --cwd=$WEB_DIR serve" \
|
||||
"cross-env yarn --cwd=$WEB_DIR ts-watch"
|
||||
else
|
||||
npx dotenv -e .env -- npx concurrently \
|
||||
npx dotenv "${DOTENV_FILES[@]}" -- npx concurrently \
|
||||
-n API,NEXT \
|
||||
-c white,magenta \
|
||||
"cross-env ENVIRONMENT=$NEXT_ENV yarn --cwd=backend/api dev" \
|
||||
|
||||
Reference in New Issue
Block a user