We have a need to trigger recompilation of a module when any file inside a 
directory is added or removed since we add the list of files at compilation 
time as a module attribute which is used in guard statements.

Something like

```
defmodule Example do
  @files File.ls!("some-path")
end
```

I think Phoenix's `embed_templates` would have to use a similar feature if 
Phoenix didn't take care of triggering recompilation itself.

Implementation wise I'd think it might probably suffice to set the `digest` 
as the hash of the list of files (probably recursively?) in the directory, 
but there might be better ways to do this.

If there is another already existing way to achieve the same please let me 
know, maybe I'm just missing something!

Best regards, Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/743e4012-af1b-437d-8277-97cd5bb302aan%40googlegroups.com.

Reply via email to