Mix tasks for editing config files?

Is there a good way to edit existing project config files with a Mix task? The use case is to facilitate toggling features in a project. Thanks.

Hi @ekobi, mix config files are code, not data structures, so they aren’t easy to automatically manipulate. If I want feature flags that turn off / on easily in development I often us environment variables, which I read in the config files.

Got it, thanks. Environment vars are a good idea – better than sed :>

Env vars are a good option, also depending on your use case GitHub - tompave/fun_with_flags: Feature Flags/Toggles for Elixir · GitHub might be worth evaluating.

Thanks for the pointer.