I have an elixir project with a defined version. How can I access this from within the running application.
in mix.exs
def project do [app: :my_app
Here's a similar approach to retrieve the version string. It also relies on the :application module, but is maybe a bit more straightforward:
:application
{:ok, vsn} = :application.get_key(:my_app, :vsn) List.to_string(vsn)