File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -387,13 +387,22 @@ defmodule Mix do
387
387
:ok
388
388
end
389
389
390
- @ doc false
390
+ @ impl true
391
391
def start ( _type , [ ] ) do
392
+ Mix.Local . append_archives ( )
393
+ Mix.Local . append_paths ( )
392
394
children = [ Mix.State , Mix.TasksServer , Mix.ProjectStack ]
393
395
opts = [ strategy: :one_for_one , name: Mix.Supervisor , max_restarts: 0 ]
394
396
Supervisor . start_link ( children , opts )
395
397
end
396
398
399
+ @ impl true
400
+ def stop ( _data ) do
401
+ Mix.Local . remove_archives ( )
402
+ Mix.Local . remove_paths ( )
403
+ :ok
404
+ end
405
+
397
406
@ doc """
398
407
Returns the current Mix environment.
399
408
@@ -827,7 +836,6 @@ defmodule Mix do
827
836
]
828
837
829
838
started_apps = Application . started_applications ( )
830
- :ok = Mix.Local . append_archives ( )
831
839
:ok = Mix.ProjectStack . push ( @ mix_install_project , config , "nofile" )
832
840
build_dir = Path . join ( install_dir , "_build" )
833
841
external_lockfile = expand_path ( opts [ :lockfile ] , deps , :lockfile , "mix.lock" )
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ defmodule Mix.CLI do
5
5
Runs Mix according to the command line arguments.
6
6
"""
7
7
def main ( args \\ System . argv ( ) ) do
8
- Mix.Local . append_archives ( )
9
- Mix.Local . append_paths ( )
10
8
Mix . start ( )
11
9
12
10
if env_variable_activated? ( "MIX_QUIET" ) , do: Mix . shell ( Mix.Shell.Quiet )
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ defmodule Mix.Local do
78
78
Enum . each ( mix_paths ( ) , & Code . append_path / 1 )
79
79
end
80
80
81
+ @ doc """
82
+ Removes Mix paths from the Erlang code path.
83
+ """
84
+ def remove_paths do
85
+ Enum . each ( mix_paths ( ) , & Code . delete_path / 1 )
86
+ end
87
+
81
88
defp mix_paths do
82
89
if path = System . get_env ( "MIX_PATH" ) do
83
90
String . split ( path , path_separator ( ) )
You can’t perform that action at this time.
0 commit comments