question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch environment file with `-e` flag

See original GitHub issue

prisma2 -e .env-file

Use case, developing locally, deploying to lambda using serverless, my package.json would have the following script:

"deploy-production": "yarn prisma2 lift up --auto-approve && sls deploy --stage production",

To make it work without this, I need to do the following for all env vars

"deploy-production": "DB_URL=$(cat .env.production | grep DB_URL | cut -d '=' -f 2) yarn prisma2 lift up --auto-approve && sls deploy --stage production",

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:18
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
schicklingcommented, Dec 31, 2019

I like the idea but would suggest to call the argument --env-file same as Docker:

image

6reactions
dkozmacommented, Mar 9, 2020

This also seems relevant for making yarn prisma2 generate work with an .env in the project root (instead of the prisma folder) as discussed in #1519, unless someone else knows another way to run that without copying/symlinking my application’s .env file to the prisma folder (or managing multiple .env files).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use Environment Files with env-cmd | DigitalOcean
Learn how to add handle environment variables with the env-cmd package.
Read more >
env Command - IBM
The env command allows you to display your current environment or run a specified command in a changed environment. If no flags or...
Read more >
Set environment variables from file of key/value pairs
set allows you to change the values of shell options and set the positional parameters, or to display the names and values of...
Read more >
Basics → Environment - Vapor Docs
You can pass either the full or short name to the --env ( -e ) flag. vapor run serve -e prod. Process Variables¶....
Read more >
Replace environment variables in a file with their actual values?
Common flags: * -h | --help: Display this message. ... compgen -e lists environment variable names without values, for example:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found