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.

Load .envrc files like direnv.

See original GitHub issue

Either in addition to or as a fallback in case of missing .env file, it may be nice to also check for .envrc file, e.g. from direnv, and gracefully attempt to parse & load it.

Probably relies on an implementation of #112.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AndersDJohnsoncommented, Dec 31, 2015

@wilmoore I figured. Why? Might not be running the app from the current working directory, or from a different user account e.g. a system account that’s not running with a shell and/or doesn’t have direnv configured . Might want to use dotenv on a server to provide environment-specific configuration to the deployed application, defaulting to variables specified for local dev in .envrc via direnv.

1reaction
wilmoorecommented, Dec 31, 2015

@adjohnson916 This should work for very specific cases where you are absolutely sure that your .envrc file only includes variable assignments; however, it could easily go south if your .envrc file includes other commands which dotenv does not support.

Also, I’m just curious to hear of other people’s workflow…if you are already using direnv, why use dotenv locally at all? Shouldn’t direnv allow be enough?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for .env files · Issue #284 · direnv/direnv - GitHub
Is there a way to have a .envrc file in a parent directory that contains dotenv so that it loads .env files in...
Read more >
direnv – unclutter your .profile | direnv
This file is loaded and it's content made available to any .envrc file. direnv is not loading the .envrc into the current shell....
Read more >
A guide to manage your environment variables in a better way ...
Using direnv in your projects. To start using direnv , you just need an .envrc file in your project. Let's create a project...
Read more >
5 Ways to Manage Environment Variables with direnv
There are several ways to do this, like running a Vault or 1Password ... It tells direnv to search for and use other...
Read more >
docker-compose .env vs direnv .envrc - Stack Overflow
Using the same file with docker-compose doesn't seem to work, only without export I get the value for the variable. NODE_ENV=development. Any ...
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