Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/mix/lib/mix/local.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defmodule Mix.Local do
def path_for(:escript), do: Mix.path_for(:escripts)

@doc """
Appends archives paths into Erlang code path.
Appends archive paths to the Erlang code path.
"""
def append_archives do
for archive <- archives_ebins() do
Expand All @@ -46,7 +46,18 @@ defmodule Mix.Local do
end

@doc """
Appends Mix paths into Erlang code path.
Removes archive paths from Erlang code path.
"""
def remove_archives do
for archive <- archives_ebins() do
Code.delete_path(archive)
end

:ok
end

@doc """
Appends Mix paths to the Erlang code path.
"""
def append_paths do
Enum.each(mix_paths(), &Code.append_path(&1))
Expand Down
6 changes: 5 additions & 1 deletion lib/mix/test/mix/tasks/archive_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ defmodule Mix.Tasks.ArchiveTest do
File.rm_rf!(tmp_path("userhome"))
System.put_env("MIX_ARCHIVES", tmp_path("userhome/.mix/archives/"))
Mix.Project.push(ArchiveProject)
:ok

on_exit(fn ->
Mix.Local.remove_archives()
System.delete_env("MIX_ARCHIVES")
end)
end

test "archive build" do
Expand Down