dotenv-rs / dotenv

Library to help supply environment variables in testing and development
MIT License
557 stars 85 forks source link

Add default substitution #75

Closed holzgeist closed 1 year ago

holzgeist commented 2 years ago

similar to bash allow following expansions from bash man page:

   ${parameter:-word}
          Use Default Values.  If parameter is unset or null, the
          expansion of word is substituted.  Otherwise, the value of
          parameter is substituted.
   ${parameter:=word}
          Assign Default Values.  If parameter is unset or null, the
          expansion of word is assigned to parameter.  The value of
          parameter is then substituted.  Positional parameters and
          special parameters may not be assigned to in this way.
hoijui commented 2 years ago

I see you documented it well in the commit message, but not anywhere else. If I were someone deciding to merge this or not, I would want it documented somewhere potential users are likely to find it, probably best in the README under "examples" and "variable substitutions". I would also suggest you to move (close & reopen) this PR to the new, active repo: https://github.com/allan2/dotenvy

Thank you for the effort! :-)

holzgeist commented 1 year ago

Sorry for the long silence. I just have to admit to myself that I don't have the bandwidth to move the PR/add documentation/etc. Closing this