Keys deleted from .env.example when not in .env
See original GitHub issueIssue Description
Hi @codeshifu , I have this problem.
Sometimes I keep some keys in .env.example
for documentation but not in .env
because I use defaults or something.
So, if you have keys in .env.example
but not in .env
, when you sync they are deleted from .env.example
.
Example
.env
:
BOTH=1
ENV=0
.env.example
:
BOTH=2
EXAMPLE=42
ANOTHER=24
ENV=3
run sync-dotenv
then
.env.example
:
BOTH=2
ENV=3
The keys EXAMPLE
and ANOTHER
were deleted.
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Go Ahead, Delete Your .env.example File - 1Password Blog
We specify instructions on how to set up your own local environment in a .env.example file or README.md file. For every project that...
Read more >Removing a .env file from Git history - Daily Dev Tips
You can remove a file from Git by running the following command. git rm -r --cached .env. If we then push this change,...
Read more >What is the need for env and env.example files in Laravel?
env is simply used to store all sensitive files like password API key, database,and so on as environment variables to be used in...
Read more >How to use Laravel .env and .env.example files?
In your main Laravel folder you should have .env file which contains various settings, one row – one KEY=VALUE pair. And then, within...
Read more >Should I add .env to .gitignore? - Sal Ferrarello
example file. This file contains the same structure as your .env file but all of the credentials and API keys have been removed....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, I tried again while I was writing a reproducible example and now it’s not happening. I don’t know why. Maybe npm cache.
So, it’s OK, now it’s works.
Thanks
Hi @leandrojdl, this has been resolved in v2.5.0 release. See the docs for usage https://github.com/codeshifu/sync-dotenv#preserving-variables-in-sample-env