Skip to content

Commit 8023b5e

Browse files
author
José Valim
committed
Remove --if-missing when calling archive, closes #6453
1 parent 19d41f1 commit 8023b5e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/mix/lib/mix/tasks/local.hex.ex

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ defmodule Mix.Tasks.Local.Hex do
3232
@spec run(OptionParser.argv) :: boolean
3333
def run(argv) do
3434
{opts, _} = OptionParser.parse!(argv, switches: @switches)
35-
force? = Keyword.get(opts, :force, false)
36-
if_missing? = Keyword.get(opts, :if_missing, false)
3735

3836
should_install? =
39-
case {force?, if_missing?} do
40-
{false, true} -> Code.ensure_loaded?(Hex)
41-
_ -> true
37+
if Keyword.get(opts, :if_missing, false) do
38+
Code.ensure_loaded?(Hex)
39+
else
40+
true
41+
end
42+
43+
argv =
44+
if Keyword.get(opts, :force, false) do
45+
["--force"]
46+
else
47+
[]
4248
end
4349

4450
should_install? && run_install(argv)

0 commit comments

Comments
 (0)