igniter
igniter copied to clipboard
`Igniter.Project.Config.configure/6` doesn't update nested Keyword
Describe the bug
Igniter.Project.Config.configure/6 doesn't look into the keywords list properly
To Reproduce
Have a dev.exs with contents like
config :demo, DemoWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
secret_key_base: "A0DSgxjGCYZ6fCIrBlg6L+qC/cdoFq5Rmomm53yacVmN95Wcpl57Gv0sTJjKjtIp",
watchers: [
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
]
and run
Igniter.Project.Config.configure(
igniter,
"dev.exs",
:demo,
[DemoWeb.Endpoint, :http, :port],
{:code, Sourceror.parse_string!("4100")}
)
Expected behavior
Should replace port 4000 -> 4100
Actual behavior No changes apply
Workaround
The function works properly if we go one level higher, updating the entire :http list instead of just the :port key within
Igniter.Project.Config.configure(
igniter,
"dev.exs",
:demo,
[DemoWeb.Endpoint, :http],
{:code, Sourceror.parse_string!("[ip: {127, 0, 0, 1}, port: 4100]")}
)
Runtime
- Elixir version 1.16
- Erlang version 26
- OS X 14.6.1
- Igniter version 0.5.8
- any related extension versions
Thanks for the report! I won't be able to tackle this in the near future, but PRs are welcome!
I will go ahead and work on this bug!