The dotenv integration with Rails supports a number of default files that the Hanami integration does not. Specifically the .env.local style files. I like to use the .env.local files as a place to store things I don't want to commit (I have it in the .gitignore). If I make a PR adding this functionality is that a contribution you all would be willing to accept? From what I can tell it will be a change to this method. I just wanted to check in before implementing it in case this was intentional or there is an opinion to keep the one default file pattern of .env.development.
Thanks!
hey, thanks for report
Not sure that it can be helpful but I use .env.development.sample in my projects for commiting env file to the git repository and .env.development for working locally. You can check my example if you want.
@jodosha WDYT about this?
@davydovanton I think @gmanley is telling something slightly different.
Is the proposal to make create the following hierarchy from the lower to the higher priority?
.env.env.development (potentially override .env).env.development.local (potentially override .env and/or .env.development)The idea is to keep generating the first two with hanami new, but potentially supporting also the third case, if that file is present.
If this is the idea, @gmanley please proceed. 馃憤
Sample files (e.g. .env.sample) should be designed better as another feature, which I think goes beyond this specific need.
@jodosha That's correct. That is the intent. Thank you for laying it out so clearly. I should have a PR soon. I'm going to work on it this weekend. Thanks!
@davydovanton I do use sample files as well but as @jodosha explained the idea here is to have hierarchy that can allow overrides locally and for different environments. I appreciate the example, however.
@jodosha @davydovanton here is my first pass to get some feedback: https://github.com/hanami/hanami/pull/1004
Implemented by https://github.com/hanami/hanami/pull/1004
Most helpful comment
@davydovanton I think @gmanley is telling something slightly different.
Is the proposal to make create the following hierarchy from the lower to the higher priority?
.env.env.development(potentially override.env).env.development.local(potentially override.envand/or.env.development)The idea is to keep generating the first two with
hanami new, but potentially supporting also the third case, if that file is present.If this is the idea, @gmanley please proceed. 馃憤
Sample files (e.g.
.env.sample) should be designed better as another feature, which I think goes beyond this specific need.