File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,15 @@ defmodule Mix do
201201
202202 @ doc """
203203 Returns the Mix environment.
204+
205+ This function should not be used at runtime in application code (as opposed
206+ to infrastructure and build code like Mix tasks). Mix is a build tool and may
207+ not be available after the code is compiled (for example in a release).
208+
209+ To differentiate the program behavior depending on the environment, it is
210+ recommended to use application environment through `Application.get_env/3`.
211+ Proper configuration can be set in `Mix.Config` files, often per-environment
212+ (see `Mix.Config.import_config/1` for more information).
204213 """
205214 def env do
206215 # env is not available on bootstrapping, so set a :dev default
@@ -212,6 +221,9 @@ defmodule Mix do
212221
213222 Be careful when invoking this function as any project
214223 configuration won't be reloaded.
224+
225+ This function should not be used at runtime in application code
226+ (see `env/0` for more information).
215227 """
216228 def env ( env ) when is_atom ( env ) do
217229 Mix.State . put ( :env , env )
You can’t perform that action at this time.
0 commit comments