Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings to .env.vault to customize things like .gitignore #229

Open
www-chique opened this issue Jan 25, 2023 · 2 comments
Open

Add settings to .env.vault to customize things like .gitignore #229

www-chique opened this issue Jan 25, 2023 · 2 comments

Comments

@www-chique
Copy link

www-chique commented Jan 25, 2023

The problem

dotenv-vault pull and dotenv-vault push modifying my gitignore file every time.

Proposal

Removing the following checks on pull and push

    new AppendToDockerignoreService().run()
    new AppendToGitignoreService().run()
    new AppendToNpmignoreService().run()

Little explanation

I have noticed that during all the commands (pull, push, etc), it checks .gitignore (and also .npmignore, .dockerignore) for existence of the ".env", "!.env.vault", etc., and modifies the gitignore file if it doesn't adhere to the specific gitignore lines it's looking for.
It makes total sense when creating a new / linking an existing project, but not on every pull and push.

Why? / My use case

As mentioned in #228 , a use case exists where I would like to not commit the .env.vault / .env.project into the repository, so I had to manually change these gitignores automatically added by dotenv-vault.
What this means is, I manually and intentionally removed the !.env.vault and !.env.project from my gitignore.
But on every pull and push, they are added again, which is not what I want.

Please note: I am totally fine with the code automatically adding these git-ignores during new or build. I just don't want it to modify the file again during a dotenv-vault pull or push and alter my own git-ignore modifications.

P.S. Big fan of dotenv-vault!

@motdotla
Copy link
Member

@www-chique good point. That is annoying. I don't like when software gets in the way.

I think we will adjust to your suggestion - just on new and build (with the ability to force ignore). Let me think on that.

One thing we have also kicked around is using the .env.vault itself as instructions for these commands - that the dotenv-vault cli would obey. Basically mapping default flags to flags inside of the .env.vault file.

This way each individual could create their project with their chosen settings - gitignore append always on, bypass open ui prompt always on, etc.

@www-chique
Copy link
Author

@motdotla - That sounds amazing!
Since you already added it to the roadmap at #238 , you can close this thread if you like. Since that will solve my problem.

@motdotla motdotla changed the title Is it necessary to check/append gitignore on all commands? Add settings to .env.vault to customize things like .gitignore Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants