ca1989
Run a dependency command when file changes
Hi all,
I have a Phoenix project PrjA with a path dependency DepA.
My goal is to be able to edit DepA and have the PrjA server to:
- recompile
- reload
- run a mix task of
DepA
1 is easy, using the :reloadable_apps option of Phoenix.CodeReloader.reload
2 is not so important
Regarding 3, I would love to run mix assets.build in DepA from PrjA.
My current solution is to run a task that rebuilds the assets in another shell from DepA.
I was wondering if there’s a way to avoid that.
Cheers
Marked As Solved
axelson
If this is for development than I think the easiest way is to use GitHub - falood/exsync: Yet another elixir reloader. · GitHub and set its reload_callback to a function that calls the mix task. You’ll also have to use a path dependency.
Also Liked
slouchpie
A generic solution is to use entr. GitHub - eradman/entr: Run arbitrary commands when files change · GitHub
It is a command line tool that lets you do anything when any files change.
For example, here is how I “re-create docs when any of the lib files change”:
find lib/ | entr -s 'mix format; mix docs -f html;'
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









