@@ -302,7 +302,7 @@ defmodule Mix do
302302 * `MIX_HOME` - path to Mix's home directory, stores configuration files and scripts used by Mix
303303 (default: `~/.mix`)
304304 * `MIX_INSTALL_DIR` - (since v1.12.0) specifies directory where `Mix.install/2` keeps
305- installs cache
305+ * `MIX_INSTALL_FORCE` - (since v1.13.0) runs `Mix.install/2` with empty install cache
306306 * `MIX_PATH` - appends extra code paths
307307 * `MIX_QUIET` - does not print information messages to the terminal
308308 * `MIX_REBAR` - path to rebar command that overrides the one Mix installs
@@ -318,9 +318,7 @@ defmodule Mix do
318318 Environment variables that are not meant to hold a value (and act basically as
319319 flags) should be set to either `1` or `true`, for example:
320320
321- ```bash
322- $ MIX_DEBUG=1 mix compile
323- ```
321+ $ MIX_DEBUG=1 mix compile
324322 """
325323
326324 @ mix_install_project __MODULE__ . InstallProject
@@ -550,8 +548,9 @@ defmodule Mix do
550548
551549 ## Options
552550
553- * `:force` - if `true`, removes install cache. This is useful when you want
554- to update your dependencies or your install got into an inconsistent state
551+ * `:force` - if `true`, runs with empty install cache. This is useful when you want
552+ to update your dependencies or your install got into an inconsistent state.
553+ To use this option, you can also set the `MIX_INSTALL_FORCE` environment variable.
555554 (Default: `false`)
556555
557556 * `:verbose` - if `true`, prints additional debugging information
@@ -670,7 +669,7 @@ defmodule Mix do
670669 |> :erlang . md5 ( )
671670 |> Base . encode16 ( case: :lower )
672671
673- force? = ! ! opts [ :force ]
672+ force? = System . get_env ( "MIX_INSTALL_FORCE" ) in [ "1" , "true" ] or ! ! opts [ :force ]
674673
675674 case Mix.State . get ( :installed ) do
676675 nil ->
0 commit comments