Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Igniter.Project.Config.configure/6 doesn't update nested Keyword #194

Open
APB9785 opened this issue Jan 15, 2025 · 1 comment
Open

Igniter.Project.Config.configure/6 doesn't update nested Keyword #194

APB9785 opened this issue Jan 15, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@APB9785
Copy link
Contributor

APB9785 commented Jan 15, 2025

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
@APB9785 APB9785 added the bug Something isn't working label Jan 15, 2025
@zachdaniel
Copy link
Contributor

Thanks for the report! I won't be able to tackle this in the near future, but PRs are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Someday
Development

No branches or pull requests

2 participants