summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE.md2
-rw-r--r--lib/mix/lib/mix/tasks/local.hex.ex17
-rw-r--r--lib/mix/lib/mix/utils.ex2
3 files changed, 15 insertions, 6 deletions
diff --git a/RELEASE.md b/RELEASE.md
index 9959e1f21..d7507a8f3 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -14,7 +14,7 @@ This document simply outlines the release process:
5. Run `make clean test` to ensure all tests pass from scratch and the CI is green
-6. Ensure minimum supported Hex works with new release (instructions upcoming)
+6. Ensure minimum supported Hex works with new release (check Mix.Tasks.Local.Hex)
7. Push branch and the new tag
diff --git a/lib/mix/lib/mix/tasks/local.hex.ex b/lib/mix/lib/mix/tasks/local.hex.ex
index a53a11c1d..6609710fc 100644
--- a/lib/mix/lib/mix/tasks/local.hex.ex
+++ b/lib/mix/lib/mix/tasks/local.hex.ex
@@ -5,6 +5,7 @@ defmodule Mix.Tasks.Local.Hex do
@hex_list_url @hex_s3 <> "/installs/list.csv"
@hex_archive_url @hex_s3 <> "/installs/[VERSION]/hex.ez"
@hex_requirement ">= 0.5.0"
+ @fallback_elixir "1.0.0"
@shortdoc "Install hex locally"
@@ -81,10 +82,18 @@ defmodule Mix.Tasks.Local.Hex do
end
defp get_matching_version do
- Mix.Utils.read_path!(@hex_list_url, [system: true])
- |> parse_csv
- |> all_eligibile_versions
- |> List.last
+ try do
+ Mix.Utils.read_path!(@hex_list_url, [system: true])
+ rescue
+ Mix.Error ->
+ @fallback_elixir
+ else
+ csv ->
+ csv
+ |> parse_csv
+ |> all_eligibile_versions
+ |> List.last
+ end
end
defp parse_csv(body) do
diff --git a/lib/mix/lib/mix/utils.ex b/lib/mix/lib/mix/utils.ex
index 6b7ac71b0..fe13f3732 100644
--- a/lib/mix/lib/mix/utils.ex
+++ b/lib/mix/lib/mix/utils.ex
@@ -483,7 +483,7 @@ defmodule Mix.Utils do
~s[$client.DownloadFile(\\"#{path}\\", \\"#{out_path}\\")]
Mix.shell.cmd(~s[powershell -Command "& {#{command}}"])
System.find_executable("curl") ->
- Mix.shell.cmd(~s[curl -sSL -o "#{out_path}" "#{path}"])
+ Mix.shell.cmd(~s[curl -sSfL -o "#{out_path}" "#{path}"])
System.find_executable("wget") ->
Mix.shell.cmd(~s[wget -nv -O "#{out_path}" "#{path}"])
windows? ->