Programming Phoenix LiveView B7: Page 141

Saw this and it reminded me of an issue I ran into in some code I was writing elsewhere.

dest = Path.join("priv/static/images", Path.basename(path))

While ok for running directly to develop the code like we are, this may be problematic if copied into code that some tries using this sort of thing in a release etc.

Instead a more reliable way to get to priv is via :code.priv_dir/1
Found that here from the answer provided by NobbZ: Accessing the priv folder from Mix release - Questions / Help - Elixir Programming Language Forum

So for example - I used this and it worked fine:
dest = Path.join("#{:code.priv_dir(:pento)}/static/images", Path.basename(path))