ash-project / igniter

A code generation and project patching framework.
https://hexdocs.pm/igniter/readme.html
MIT License
155 stars 20 forks source link

support for non-elixir files with create_new_file, update_file, include_existing_file, include_or_create_file, create_or_update_file #75

Closed mayel closed 2 months ago

mayel commented 2 months ago

to start a discussion about how best to add support for patching non-elixir files

zachdaniel commented 2 months ago

This looks good to me 👍

zachdaniel commented 2 months ago

Happy to merge as is, but the title does say DRAFT, so LMK if its good to merge on your end :)

mayel commented 2 months ago

Great :) Marking as draft was because it needs a test, and maybe refactoring other functions in a similar way, such ascreate_or_update_elixir_file and include_or_create_elixir_file (adding create_or_update_file and include_or_create_file).

I see there's already include_existing_file and update_file functions but they includes a call to format so not sure if they're intended to work with non-elixir files?

mayel commented 2 months ago

Added a test, I guess the rest can also follow in other PRs

zachdaniel commented 2 months ago

Yeah, I think there is no need to load it up in one PR, happy to see separate PRs. Although, if you're going to do the other ones in the near future, we can leave it open and have it be one PR. Its your call 😄

mayel commented 2 months ago

Cool on it, easier to do while fresh than context switch :)

mayel commented 2 months ago

done :)