Skip to content

Commit 7c0f6dd

Browse files
author
José Valim
committed
Show overriding information when using path with query string
1 parent f8d775c commit 7c0f6dd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/mix/lib/mix/local/installer.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ defmodule Mix.Local.Installer do
9999
defp do_install({module, name}, src, opts) do
100100
src_basename = Path.basename(URI.parse(src).path)
101101
dst = Path.join(Mix.Local.path_for(name), src_basename)
102-
previous_files = module.find_previous_versions(src, dst)
102+
previous_files = module.find_previous_versions(src_basename, dst)
103103

104104
if opts[:force] || should_install?(name, src, previous_files) do
105105
case Mix.Utils.read_path(src, opts) do

lib/mix/test/mix/tasks/archive_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ defmodule Mix.Tasks.ArchiveTest do
5252
archive = tmp_path("userhome/.mix/archives/archive-0.1.0/archive-0.1.0/ebin")
5353
assert to_charlist(archive) in :code.get_path
5454

55+
# Try to override it with URL
56+
send self(), {:mix_shell_input, :yes?, false}
57+
Mix.Tasks.Archive.Install.run ["https://example.com/archive-0.1.0?hello.ez"]
58+
assert_received {:mix_shell, :yes?, ["Found existing archive: " <> _]}
59+
5560
# Loading the archive should emit warning again
5661
Mix.Local.append_archives
5762
assert_received {:mix_shell, :error, [^version_error]}

0 commit comments

Comments
 (0)