Skip to content

Conversation

@Julien-R44
Copy link
Member

As explained here: adonisjs/core#4533

We add a third argument withEmptyExampleValue to the EnvEditor add method which allows to insert a empty value in the .env.example file

const editor = await EnvEditor.create(fs.baseUrl)
editor.add('PORT', 3000, true)

This will result in PORT=3000 in the .env file, but with PORT= in the .env.example file.

@Julien-R44
Copy link
Member Author

Julien-R44 commented Apr 27, 2024

CI failing on windows due to nodejs/node#52682

I've temporarily disabled it until issue is resolved. See this commit adonisjs/.github@535382e

@Julien-R44 Julien-R44 requested a review from thetutlage April 29, 2024 08:04
@thetutlage
Copy link
Member

Actually, I have no issue with the implementation. We are making EnvEditor class to know about the .env.example file and how it should be treated different to others.

Ideally, this logic should be handled in the place where we use the EnvEditor to update two files, i.e .env and .env.example.

@thetutlage
Copy link
Member

Wait. Ignore my last comment. I thought that EnvEditor could be used to edit one file at a time by giving it's name.

Turns out that is not the case, and we already have hardcoded logic inside it.

@thetutlage thetutlage merged commit 418e443 into develop Apr 29, 2024
@Julien-R44 Julien-R44 deleted the feat/empty-example branch April 29, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants