Skip to content

Commit

Permalink
Unload hex application to fix compatability between Hex versions
Browse files Browse the repository at this point in the history
Starting hex <0.21 from mix.exs crashes if hex 0.21+ is already loaded.
In the past we unloaded all current BEAM modules so that the development
version of Hex can be started when Hex is installed on your system.
We did not unload the application so when the application :mod key
changed we crashed. Fix by unloading and reloading the application as
well as the BEAM modules.
  • Loading branch information
ericmj committed Jan 15, 2021
1 parent 6848398 commit 278bcc5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ defmodule Hex.MixProject do

defp unload_hex(_) do
Application.stop(:hex)
Application.unload(:hex)
paths = Path.wildcard(Path.join(archives_path(), "hex*"))

Enum.each(paths, fn archive ->
Expand Down

0 comments on commit 278bcc5

Please sign in to comment.