bitwalker / bitwalker/toml-elixir

When called from distillery as a provider, config isn't actually merged an instead is overrwritten for any app in the TOML config.

Open
#26 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
206
Forks
32
PR merge metrics
No merged PRs in 30d

Description

When called from distillery as a provider, config isn't actually merged and instead is overrwritten for any app in the TOML config.

It's unclear to me if we should be solving this here or at the Distillery level, however other config providers appear to solve it internally...

The issue is that persist tries to merge the incoming config, but with Distillery the incoming config is always empty.

```
defp persist(config, keyword) when is_list(keyword) do
config = Config.Reader.merge(config, keyword)
Application.put_all_env(config, persistent: true)
config
end
```

In persist `config` is always `[]` when called from Distillery because `load` is called as:

```
if is_distillery_env?() do
# When running under Distillery, init performs load
load([], opts)
opts
else
```

Because of this we end up with any existing config being overwritten on an application level.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.