Mix.env
env
, go back to Mix module for more information.
Specs
env() :: atom()
Returns the current Mix environment.
This function should not be used at runtime in application code (as opposed to infrastructure and build code like Mix tasks). Mix is a build tool and may not be available after the code is compiled (for example in a release).
To differentiate the program behavior depending on the environment, it is
recommended to use application environment through Application.get_env/3
.
Proper configuration can be set in config files, often per-environment
(see the Config
module for more information).
Specs
env(atom()) :: :ok
Changes the current Mix environment to env
.
Be careful when invoking this function as any project configuration won't be reloaded.
This function should not be used at runtime in application code
(see env/0
for more information).