Skip to content

Unset envvar subs dont overwrite with nils#27

Open
ddillinger wants to merge 2 commits intosonian:masterfrom
ddillinger:env-subs-dont-overwrite-nils
Open

Unset envvar subs dont overwrite with nils#27
ddillinger wants to merge 2 commits intosonian:masterfrom
ddillinger:env-subs-dont-overwrite-nils

Conversation

@ddillinger
Copy link
Copy Markdown

Although I didn't need this for the thing I wanted the original feature for, it occurred to me while using it that there's certainly a use case for overriding an existing default via environment, and the first implementation couldn't do that. If you didn't set the envvar, it always returned nil for the config coordinates, even if you had something set there in the file on disk.

Also, I got to use paredit-convolute-sexp while tweaking the tests, which means I am having a spectacular morning already.

Dan Dillinger added 2 commits November 22, 2016 10:09
If the envvar is unset, System/getenv returns a nil, which was being
assoc'd in place. So you couldn't actually have a default in config,
that you *optionally* override with an envvar. It'd just always be nil.

This changes that so that if the envvar is unset, it won't assoc to the
location; if a key did exist there it will now return.
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.

1 participant