Skip to content

Commit 982aba3

Browse files
author
José Valim
committed
Always skip deps with MIX_NO_DEPS
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
1 parent 56f1037 commit 982aba3

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

lib/mix/lib/mix/dep.ex

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,15 @@ defmodule Mix.Dep do
7171
against the lock.
7272
"""
7373
def cached do
74-
if project = Mix.Project.get do
75-
key = {:cached_deps, project}
76-
Mix.ProjectStack.read_cache(key) ||
77-
Mix.ProjectStack.write_cache(key, loaded(env: Mix.env))
78-
else
79-
loaded(env: Mix.env)
74+
cond do
75+
System.get_env("MIX_NO_DEPS") in ~w(1 true) ->
76+
[]
77+
project = Mix.Project.get ->
78+
key = {:cached_deps, project}
79+
Mix.ProjectStack.read_cache(key) ||
80+
Mix.ProjectStack.write_cache(key, loaded(env: Mix.env))
81+
true ->
82+
loaded(env: Mix.env)
8083
end
8184
end
8285

lib/mix/lib/mix/tasks/deps.loadpaths.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defmodule Mix.Tasks.Deps.Loadpaths do
3333
path
3434
end
3535

36-
prune_deps(load_paths, "--no-deps-check" in args)
36+
prune_deps(load_paths, "--no-deps-check" in args or System.get_env("MIX_NO_DEPS") in ~w(1 true))
3737
end
3838

3939
# If the build is per environment, we should be able to look

lib/mix/lib/mix/tasks/loadpaths.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule Mix.Tasks.Loadpaths do
3232

3333
# --no-deps is used only internally. It has no purpose
3434
# from Mix.CLI because running a task may load deps.
35-
unless "--no-deps" in args or System.get_env("MIX_NO_DEPS") in ~w(1 true) do
35+
unless "--no-deps" in args do
3636
Mix.Task.run "deps.loadpaths", args
3737
end
3838

0 commit comments

Comments
 (0)