docs icon indicating copy to clipboard operation
docs copied to clipboard

Supply .env file via symlink

Open janpio opened this issue 5 years ago • 1 comments

Interesting suggestion from a user: Besides using dotenv in code or dotenv-cli you can also make it work by adding a symlink between you custom .env file location and /prisma/.env: https://prisma.slack.com/archives/CKQTGR6T0/p1594635028120700?thread_ts=1594401216.096200&cid=CKQTGR6T0

Originally posted by @janpio in https://github.com/prisma/docs/issues/639#issuecomment-657500037

janpio avatar Jul 21 '20 08:07 janpio

@janpio Symlinks doesn't work at all, I was trying to add .env to my prisma package with following content which points to my main .env and it doesn't see variables defined in my root.

# .env
./../../.env

Nevermind, like... I was doing this .env by hand instead to actually use ln -s ../../.env packages/prisma-db/.env. It works perfectly 😃

keinsell avatar Jul 20 '22 20:07 keinsell

Is this still relevant since we don't have prisma/.env any more, @janpio?

nikolasburk avatar Mar 27 '23 16:03 nikolasburk

I would assume that also works with the main .env file. Not sure if it is worth documenting though necessarily.

janpio avatar Mar 27 '23 18:03 janpio

In that case, we'll close this for now 👍

nikolasburk avatar Apr 11 '23 15:04 nikolasburk